Re: need help debugging a weird md/devfs problem...

Neil Brown (neilb@cse.unsw.edu.au)
Wed, 15 Aug 2001 15:01:44 +1000 (EST)


On Tuesday August 14, kevin@labsysgrp.com wrote:
>
> Anyone have any suggesting as to where to continue looking to find the
> problem? I can put a workaround in to get my machine working, but there's
> definitely something very weird going on here. Too bad I can't just tell the
> kernel to notify me when that particular memory location gets modified...
>

The arrays in the "struct gendisk" are only allocated big enough to
hold any drives that were found. See init_gendisk in
drivers/ide/ide-probe.c

In your situation device 3,67 is being referenced, which is hdb3. As
hdb was not detected, the arrays, particularly the partition array is
not big enough to refer to that. So when disk_name does:
hd->part[minor].de
is it indexing off the end of an array an getting garbage.

At least, that is my 5minute assessment.

If I am right, the following patch should fix it for you.

NeilBrown

--- fs/partitions/check.c 2001/08/15 04:56:57 1.1
+++ fs/partitions/check.c 2001/08/15 04:57:47
@@ -101,7 +101,7 @@
int unit = (minor >> hd->minor_shift) + 'a';

part = minor & ((1 << hd->minor_shift) - 1);
- if (hd->part[minor].de) {
+ if (unit < hd->nr_real && hd->part[minor].de) {
int pos;

pos = devfs_generate_path (hd->part[minor].de, buf, 64);
-
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/