From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Mikkel Erup <mikkelerup@yahoo.com>,
Al Viro <viro@ftp.linux.org.uk>, Jens Axboe <axboe@suse.de>
Cc: Pierre Ossman <drzeus-list@drzeus.cx>, Greg KH <greg@kroah.com>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: sdhci driver produces kernel oops on ejecting the card
Date: Wed, 12 Apr 2006 10:30:20 +0100 [thread overview]
Message-ID: <20060412093020.GB25799@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20060411194356.4573.qmail@web52107.mail.yahoo.com>
On Tue, Apr 11, 2006 at 12:43:56PM -0700, Mikkel Erup wrote:
> > --- Russell King <rmk+lkml@arm.linux.org.uk> wrote:
> >
> > > So the
> > > only place for sane
> > > refcounting seems to be genhd.c, as per the patch
> > > below.
> > >
> > > Comments?
> > >
> > > diff -up -x BitKeeper -x ChangeSet -x SCCS -x _xlk
> > -x
> > > *.orig -x *.rej -x .git a/block/genhd.c
> > > b/block/genhd.c
> > > --- a/block/genhd.c Sat Feb 18 10:31:37 2006
> > > +++ b/block/genhd.c Fri Apr 7 15:22:21 2006
> > > @@ -262,6 +262,7 @@ static int exact_lock(dev_t
> > dev,
> > > void *d
> > > */
> > > void add_disk(struct gendisk *disk)
> > > {
> > > + get_device(disk->driverfs_dev);
> > > disk->flags |= GENHD_FL_UP;
> > > blk_register_region(MKDEV(disk->major,
> > > disk->first_minor),
> > > disk->minors, NULL, exact_match,
> > exact_lock,
> > > disk);
> > > @@ -507,6 +508,7 @@ static struct attribute *
> > > default_attrs[
> > > static void disk_release(struct kobject * kobj)
> > > {
> > > struct gendisk *disk = to_disk(kobj);
> > > + put_device(disk->driverfs_dev);
> > > kfree(disk->random);
> > > kfree(disk->part);
> > > free_disk_stats(disk);
> >
> > I can confirm that this patch is working.
> > The 2.6.16-git20 kernel doesn't oops on
> > ejecting the card after the patch is applied.
> >
> > Mikkel
>
> I didn't see anything regarding this on sdchi-devel or lkml for a
> week or so, so I thought I'd just make sure it's not forgotten.
> This patch works really well for me. The kernel no longer oopses
> on ejecting the card because a NULL pointer is no longer
> dereferenced and I think the patch should be considered.
I think it needs someone like Al Viro or Jens Axboe to review it.
I sent the patch to them originally, but when you replied, your mailer
removed them from your reply.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
next prev parent reply other threads:[~2006-04-12 9:31 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-11 19:43 Mikkel Erup
2006-04-12 9:30 ` Russell King [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-04-02 19:48 Mikkel Erup
2006-04-02 20:29 ` Greg KH
2006-04-03 22:19 ` Mikkel Erup
2006-04-07 8:47 ` Pierre Ossman
2006-04-07 14:40 ` Russell King
2006-04-07 20:29 ` Mikkel Erup
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060412093020.GB25799@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=akpm@osdl.org \
--cc=axboe@suse.de \
--cc=drzeus-list@drzeus.cx \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mikkelerup@yahoo.com \
--cc=viro@ftp.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome