[BUG-2.5.24-BK] DriverFS panics on boot!

James Bottomley (James.Bottomley@SteelEye.com)
Thu, 04 Jul 2002 11:41:22 -0400


This is a multipart MIME message.

--==_Exmh_-20731811840
Content-Type: text/plain; charset=us-ascii

Er, oops, I think this one's my fault.

The recent driverfs additions for SCSI also added partition handling in
driverfs. The code is slightly more invasive than it should be so the IDE
driver needs to know how to use it (which it doesn't yet). In theory there's
a NULL pointer check in driverfs_create_partitions for precisely this case,
but it looks like the IDE code is forgetting to zero out a kmalloc of a struct
gendisk somewhere (hence the 5a5a... contents). At a cursory glance, this
seems to be in ide/probe.c, so does the attached patch fix it?

I'll try to reproduce, but I'm all SCSI here except for my laptop.

James

--==_Exmh_-20731811840
Content-Type: text/plain ; name="tmp.diff"; charset=us-ascii
Content-Description: tmp.diff
Content-Disposition: attachment; filename="tmp.diff"

===== drivers/ide/probe.c 1.58 vs edited =====
--- 1.58/drivers/ide/probe.c Fri Jun 14 09:11:19 2002
+++ edited/drivers/ide/probe.c Thu Jul 4 10:31:35 2002
@@ -1143,6 +1143,7 @@
if (!gd)
goto err_kmalloc_gd;

+ memset(gd, 0, sizeof(struct gendisk));
gd->sizes = kmalloc(ATA_MINORS * sizeof(int), GFP_KERNEL);
if (!gd->sizes)
goto err_kmalloc_gd_sizes;

--==_Exmh_-20731811840--

-
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/