linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: viro@parcelfarce.linux.theplanet.co.uk
To: Helge Hafting <helgehaf@aitel.hist.no>
Cc: Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: 2.6.0-test5-mm4 boot crash
Date: Wed, 24 Sep 2003 10:57:54 +0100	[thread overview]
Message-ID: <20030924095754.GW7665@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <3F716177.6060607@aitel.hist.no>

On Wed, Sep 24, 2003 at 11:18:47AM +0200, Helge Hafting wrote:
> Unable to handle null pointer deref at virtual address 00000000
> eip c02b7d1e  eip at md_probe

Oh, boy...  OK, I see what happens and it's _ugly_.  md_probe() is misused
there big way.  The minimal fix is to revert the cleanup in md_probe() -
replace
	int unit = *part;
with
	int unit = MINOR(dev);


However, that is crap solution.  The problem is that md_probe() is called
directly with bogus arguments - not only part is NULL (which triggers the
oops), but dev (which is supposed to be dev_t value) is actually mdidx(mddev).

Cleaner fix follows, but we really need to get the situation with gendisk
allocations into the sane shape there.  Sigh...

diff -urN B5-tty_devnum-fix/drivers/md/md.c B5-current/drivers/md/md.c
--- B5-tty_devnum-fix/drivers/md/md.c	Tue Sep 23 04:16:30 2003
+++ B5-current/drivers/md/md.c	Wed Sep 24 05:44:27 2003
@@ -1500,6 +1500,7 @@
 	mdk_rdev_t *rdev;
 	struct gendisk *disk;
 	char b[BDEVNAME_SIZE];
+	int unit;
 
 	if (list_empty(&mddev->disks)) {
 		MD_BUG();
@@ -1591,8 +1592,9 @@
 		invalidate_bdev(rdev->bdev, 0);
 	}
 
-	md_probe(mdidx(mddev), NULL, NULL);
-	disk = disks[mdidx(mddev)];
+	unit = mdidx(mddev);
+	md_probe(0, &unit, NULL);
+	disk = disks[unit];
 	if (!disk)
 		return -ENOMEM;
 
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>

      reply	other threads:[~2003-09-24  9:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-22  8:35 2.6.0-test5-mm4 Andrew Morton
2003-09-22 12:09 ` 2.6.0-test5-mm4 Florian Schanda
2003-09-22 12:17 ` 2.6.0-test5-mm4 Alistair J Strachan
2003-09-22 13:48   ` 2.6.0-test5-mm4 viro
2003-09-22 14:29     ` 2.6.0-test5-mm4 Alistair J Strachan
2003-09-22 14:30   ` 2.6.0-test5-mm4 Florian Schanda
2003-09-22 14:36   ` 2.6.0-test5-mm4 Zilvinas Valinskas
2003-09-22 13:49     ` 2.6.0-test5-mm4 Alistair J Strachan
2003-09-22 13:54       ` 2.6.0-test5-mm4 Alistair J Strachan
2003-09-22 18:55     ` 2.6.0-test5-mm4 Andrew Morton
2003-09-22 21:27       ` 2.6.0-test5-mm4 Peter Osterlund
2003-09-22 21:45         ` 2.6.0-test5-mm4 Vojtech Pavlik
2003-09-25  0:13           ` 2.6.0-test5-mm4 Peter Osterlund
2003-09-25 12:43             ` 2.6.0-test5-mm4 Vojtech Pavlik
2003-09-22 21:44       ` 2.6.0-test5-mm4 Vojtech Pavlik
2003-09-24  9:18 ` 2.6.0-test5-mm4 boot crash Helge Hafting
2003-09-24  9:57   ` viro [this message]

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=20030924095754.GW7665@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=akpm@osdl.org \
    --cc=helgehaf@aitel.hist.no \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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