From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753628Ab2AZSxd (ORCPT ); Thu, 26 Jan 2012 13:53:33 -0500 Received: from alice.et.bocholt.fh-gelsenkirchen.de ([193.175.197.63]:36983 "EHLO alice.et.bocholt.fh-gelsenkirchen.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182Ab2AZSxc (ORCPT ); Thu, 26 Jan 2012 13:53:32 -0500 X-DKIM: Sendmail DKIM Filter v2.8.3 alice.et.bocholt.fh-gelsenkirchen.de q0QIrA0q018199 From: Dirk Gouders To: Tejun Heo Cc: Vivek Goyal , Suresh Jayaraman , LKML , Jens Axboe Subject: Re: Slab corruption in floppy driver module In-Reply-To: <20120126180532.GA4077@dhcp-172-17-108-109.mtv.corp.google.com> (Tejun Heo's message of "Thu, 26 Jan 2012 10:05:32 -0800") References: <4F1EAFE9.5000306@suse.com> <20120124223153.GG17291@redhat.com> <20120126150420.GD1891@redhat.com> <20120126180532.GA4077@dhcp-172-17-108-109.mtv.corp.google.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) Date: Thu, 26 Jan 2012 19:53:07 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (alice.et.bocholt.fh-gelsenkirchen.de [192.168.0.63]); Thu, 26 Jan 2012 19:53:11 +0100 (CET) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tejun Heo writes: > Hello, > > On Thu, Jan 26, 2012 at 10:04:20AM -0500, Vivek Goyal wrote: >> out_put_disk: >> while (dr--) { >> del_timer_sync(&motor_off_timer[dr]); >> - if (disks[dr]->queue) >> + if (disks[dr]->queue) { >> blk_cleanup_queue(disks[dr]->queue); >> + /* >> + * The request queue reference we took at device >> + * creation time has been put by above >> + * blk_cleanup_queue(). We have not called add_disk() >> + * yet and due to failure calling put_disk(). Put disk >> + * will try to put a reference to disk->queue which is >> + * taken in add_disk(). As we have not taken that >> + * extra reference, putting extra reference down >> + * will try to access already freed queue. Clear >> + * disk->queue before calling put_disk(). >> + */ >> + disks[dr]->queue = NULL; > > Yeah, this looks correct to me. It might be better to tone down the > comment a bit tho. Wouldn't it be sufficient to say put_disk() isn't > paired with add_disk() and will put one extra time? I tested the patch on my machine without a floppy controller and it no longer produces traces, just "floppy0: no floppy controllers found" Dirk