Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751007AbWELWPi (ORCPT ); Fri, 12 May 2006 18:15:38 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750842AbWELWPi (ORCPT ); Fri, 12 May 2006 18:15:38 -0400 Received: from smtp.osdl.org ([65.172.181.4]:53455 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S1750823AbWELWPh (ORCPT ); Fri, 12 May 2006 18:15:37 -0400 Date: Fri, 12 May 2006 15:15:10 -0700 (PDT) From: Linus Torvalds To: Russell King cc: James Bottomley , Erik Mouw , Or Gerlitz , linux-scsi@vger.kernel.org, axboe@suse.de, Andrew Vasquez , Linux Kernel Mailing List , Greg KH Subject: Re: [BUG 2.6.17-git] kmem_cache_create: duplicate cache scsi_cmd_cache In-Reply-To: <20060512215151.GG17120@flint.arm.linux.org.uk> Message-ID: References: <15ddcffd0605112153q57f139a1k7068e204a3eeaf1f@mail.gmail.com> <20060512171632.GA29077@harddisk-recovery.com> <1147456038.3769.39.camel@mulgrave.il.steeleye.com> <1147460325.3769.46.camel@mulgrave.il.steeleye.com> <20060512203850.GC17120@flint.arm.linux.org.uk> <20060512205804.GD17120@flint.arm.linux.org.uk> <20060512215151.GG17120@flint.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1626 Lines: 42 On Fri, 12 May 2006, Russell King wrote: > > From: Todd Blumer > On a PXA27x handheld (iPAQ hx4700), when we eject a mounted SD memory > card, we get a kernel panic (kernel trying to clean up non-existent > device). One hack patch to avoid the panic is: > > --- fs/partitions/check.c 10 Apr 2006 22:57:27 -0000 1.15 > +++ fs/partitions/check.c 4 May 2006 20:30:15 -0000 > @@ -491,6 +491,7 @@ > kfree(disk_name); > } > put_device(disk->driverfs_dev); > + disk->driverfs_dev = 0; /* HACK - what's the right solution? */ > } > kobject_uevent(&disk->kobj, KOBJ_REMOVE); > kobject_del(&disk->kobj); Btw, on the face it of, I really think that this patch is correct regardless of any other issues. We're clearly getting rid of "disk->driverfs_dev" (that's what the "put_device()" does). So we should clear it out - using "disk->driverfs_dev" afterwards is clearly not _valid_, because we've dropped the reference. Of course, we shouldn't assign zero to it. We should assign NULL. Alternatively, we could poison it (so that anybody who tries to use it gets a nice oops ASAP). Now, regardless of whether that is correct or not, it might not be the only problem, of course. It sounds like there is something else going on here too. Linus - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/