mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: hch@caldera.de (Christoph Hellwig)
To: adilger@turbolabs.com (Andreas Dilger)
To: Linus Torvalds <torvalds@transmeta.com>
Cc: alan@lxorguk.ukuu.org.uk (Alan Cox),
	zzz@cd-club.ru (Denis Zaitsev),
	torvalds@transmeta.com (Linus Torvalds),
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] init/main.c/root_dev_names - another one #ifdef
Date: Wed, 31 Oct 2001 18:28:14 +0100	[thread overview]
Message-ID: <200110311728.f9VHSE207521@ns.caldera.de> (raw)
In-Reply-To: <20011030182810.B800@lynx.no>

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

  reply	other threads:[~2001-10-31 17:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-30 23:53 Denis Zaitsev
2001-10-31  0:15 ` Alan Cox
2001-10-31  0:12   ` Linus Torvalds
2001-10-31  0:28     ` Alan Cox
2001-10-31  1:28     ` Andreas Dilger
2001-10-31 17:28       ` Christoph Hellwig [this message]
2001-10-31 18:20         ` Andreas Dilger
2001-10-31 18:31           ` Christoph Hellwig
2001-10-31 19:08             ` Andreas Dilger
2001-11-01  2:05     ` Denis Zaitsev
2001-10-31  1:36   ` Denis Zaitsev

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=200110311728.f9VHSE207521@ns.caldera.de \
    --to=hch@caldera.de \
    --cc=adilger@turbolabs.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=zzz@cd-club.ru \
    /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

all inboxes | Powered by JetHome®