Re: /proc/partitions broken in 2.5.23

Peter Chubb (peter@chubb.wattle.id.au)
Wed, 26 Jun 2002 13:22:16 +1000


Here's a fix that works for me (the /proc/partitions output is still broken in
2.5.24 -- it appears to be following sgp->part[n] pointers that aren't
initialised)

--- /tmp/geta29820 Wed Jun 26 13:16:14 2002
+++ linux-2.5.24/drivers/block/genhd.c Wed Jun 26 11:50:36 2002
@@ -179,8 +179,7 @@

/* show the full disk and all non-0 size partitions of it */
for (n = 0; n < (sgp->nr_real << sgp->minor_shift); n++) {
- int minormask = (1<<sgp->minor_shift) - 1;
- if ((n & minormask) && sgp->part[n].nr_sects == 0)
+ if (sgp->sizes[n] == 0)
continue;
seq_printf(part, "%4d %4d %10llu %s\n",
sgp->major, n, (unsigned long long)sgp->sizes[n],
--- /tmp/geta29832 Wed Jun 26 13:17:36 2002
+++ linux-2.5.24/drivers/ide/probe.c Wed Jun 26 11:10:00 2002
@@ -1146,6 +1146,7 @@
gd->sizes = kmalloc(ATA_MINORS * sizeof(gd->sizes[0]), GFP_KERNEL);
if (!gd->sizes)
goto err_kmalloc_gd_sizes;
+ memset(gd->sizes, 0, ATA_MINORS*sizeof(gd->sizes[0]));

gd->part = kmalloc(ATA_MINORS * sizeof(struct hd_struct), GFP_KERNEL);
if (!gd->part)
-
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/