Re: [PATCH] init/main.c/root_dev_names - another one #ifdef

Christoph Hellwig (hch@caldera.de)
Wed, 31 Oct 2001 18:28:14 +0100


In article <20011030182810.B800@lynx.no> you wrote:
> I have a patch from way back (not mine) which allows the name to be
> generated by the block device driver code. Let me know if you are
> interested. This also fixes the ugly "lvma" "lvmb" devices that are
> in /proc/partitions.

In OpenGFS CVS we have such a patch as well.
Version for -ac is attached.

Christoph

-- 
Of course it doesn't work. We've performed a software upgrade.

diff -uNr -Xdontdiff ../master/linux-2.4.10-ac4/drivers/ide/ide-probe.c linux/drivers/ide/ide-probe.c --- ../master/linux-2.4.10-ac4/drivers/ide/ide-probe.c Tue Oct 30 14:54:22 2001 +++ linux/drivers/ide/ide-probe.c Wed Oct 31 18:21:20 2001 @@ -759,6 +759,8 @@ } minors = units * (1<<PARTN_BITS); gd = kmalloc (sizeof(struct gendisk), GFP_KERNEL); + /* XXX: check for nulptr deref */ + memset(gd, 0, sizeof(*gd)); gd->sizes = kmalloc (minors * sizeof(int), GFP_KERNEL); gd->part = kmalloc (minors * sizeof(struct hd_struct), GFP_KERNEL); bs = kmalloc (minors*sizeof(int), GFP_KERNEL); diff -uNr -Xdontdiff ../master/linux-2.4.10-ac4/fs/partitions/check.c linux/fs/partitions/check.c --- ../master/linux-2.4.10-ac4/fs/partitions/check.c Tue Oct 30 14:54:29 2001 +++ linux/fs/partitions/check.c Wed Oct 31 18:20:40 2001 @@ -99,6 +99,9 @@ unsigned int unit = (minor >> hd->minor_shift); unsigned int part = (minor & ((1 << hd->minor_shift) -1 )); + if (hd->device_names) + return hd->device_names[minor]; + if ((unit < hd->nr_real) && hd->part[minor].de) { int pos; diff -uNr -Xdontdiff ../master/linux-2.4.10-ac4/include/linux/genhd.h linux/include/linux/genhd.h --- ../master/linux-2.4.10-ac4/include/linux/genhd.h Tue Oct 30 14:54:31 2001 +++ linux/include/linux/genhd.h Wed Oct 31 18:20:54 2001 @@ -83,6 +83,8 @@ devfs_handle_t *de_arr; /* one per physical disc */ char *flags; /* one per physical disc */ +#define _HAVE_GENDISK_DEVICE_NAMES + char **device_names; }; /* drivers/block/genhd.c */ - 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/