linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* new dev_t printable convention and lilo
@ 2003-08-09 22:18 Andrey Borzenkov
  2003-08-09 23:12 ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Andrey Borzenkov @ 2003-08-09 22:18 UTC (permalink / raw)
  To: linux-kernel

{pts/2}% cat /proc/cmdline
BOOT_IMAGE=260-t3smp2 ro root=345 devfs=mount

I guess it has to use 03:45 now? Does it mean lilo has to be updated to handle 
new convention?

-andrey

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new dev_t printable convention and lilo
  2003-08-09 22:18 new dev_t printable convention and lilo Andrey Borzenkov
@ 2003-08-09 23:12 ` Andrew Morton
  2003-08-13 13:15   ` "Andrey Borzenkov" 
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2003-08-09 23:12 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: linux-kernel

Andrey Borzenkov <arvidjaar@mail.ru> wrote:
>
> {pts/2}% cat /proc/cmdline
> BOOT_IMAGE=260-t3smp2 ro root=345 devfs=mount
> 
> I guess it has to use 03:45 now? Does it mean lilo has to be updated to handle 
> new convention?
> 

I think we need to teach the parsing code to handle both styles.

It's a bit of a screwup.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new dev_t printable convention and lilo
  2003-08-09 23:12 ` Andrew Morton
@ 2003-08-13 13:15   ` "Andrey Borzenkov" 
  2003-08-13 20:24     ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: "Andrey Borzenkov"  @ 2003-08-13 13:15 UTC (permalink / raw)
  To: "Andrew Morton" ; +Cc: linux-kernel



-----Original Message-----

> 
> Andrey Borzenkov <arvidjaar@mail.ru> wrote:
> >
> > {pts/2}% cat /proc/cmdline
> > BOOT_IMAGE=260-t3smp2 ro root=345 devfs=mount
> > 
> > I guess it has to use 03:45 now? Does it mean lilo has to be updated to handle 
> > new convention?
> > 
> 
> I think we need to teach the parsing code to handle both styles.
> 
> It's a bit of a screwup.
> 

sorry for late reply.

I was wrong, the code that actually uses root= was unaffected.

It happens in name_to_dev_t:

 	if (strncmp(name, "/dev/", 5) != 0) {
 		res = (dev_t) simple_strtoul(name, &p, 16);
 		if (*p)
 			goto fail;
 		goto done;
 	}

it means handle-old-dev_t is meaningless and has to be removed ; and if we want people to use new format, it needs to go into name_to_dev_t.

sorry for confusion :(


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new dev_t printable convention and lilo
  2003-08-13 13:15   ` "Andrey Borzenkov" 
@ 2003-08-13 20:24     ` Andrew Morton
  2003-08-14  5:05       ` "Andrey Borzenkov" 
  0 siblings, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2003-08-13 20:24 UTC (permalink / raw)
  To: Andrey Borzenkov; +Cc: linux-kernel

"Andrey Borzenkov" <arvidjaar@mail.ru> wrote:
>
> It happens in name_to_dev_t:
> 
>  	if (strncmp(name, "/dev/", 5) != 0) {
>  		res = (dev_t) simple_strtoul(name, &p, 16);
>  		if (*p)
>  			goto fail;
>  		goto done;
>  	}
> 
> it means handle-old-dev_t is meaningless and has to be removed ; and if we want people to use new format, it needs to go into name_to_dev_t.

It's better to handle both isn't it?



 25-akpm/init/do_mounts.c |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff -puN init/do_mounts.c~handle-old-dev_t-format init/do_mounts.c
--- 25/init/do_mounts.c~handle-old-dev_t-format	Wed Aug 13 13:07:12 2003
+++ 25-akpm/init/do_mounts.c	Wed Aug 13 13:23:18 2003
@@ -71,13 +71,19 @@ static dev_t __init try_name(char *name,
 	if (len <= 0 || len == 32 || buf[len - 1] != '\n')
 		goto fail;
 	buf[len - 1] = '\0';
-	/*
-	 * The format of dev is now %u:%u -- see print_dev_t()
-	 */
-	if (sscanf(buf, "%u:%u", &maj, &min) == 2)
+	if (sscanf(buf, "%u:%u", &maj, &min) == 2) {
+		/*
+		 * Try the %u:%u format -- see print_dev_t()
+		 */
 		res = MKDEV(maj, min);
-	else
-		goto fail;
+	} else {
+		/*
+		 * Nope.  Try old-style "0321"
+		 */
+		res = (dev_t)simple_strtoul(buf, &s, 16);
+		if (*s)
+			goto fail;
+	}
 
 	/* if it's there and we are not looking for a partition - that's it */
 	if (!part)
@@ -135,9 +141,15 @@ dev_t name_to_dev_t(char *name)
 		goto out;
 
 	if (strncmp(name, "/dev/", 5) != 0) {
-		res = (dev_t) simple_strtoul(name, &p, 16);
-		if (*p)
-			goto fail;
+		unsigned maj, min;
+
+		if (sscanf(name, "%u:%u", &maj, &min) == 2) {
+			res = MKDEV(maj, min);
+		} else {
+			res = (dev_t)simple_strtoul(name, &p, 16);
+			if (*p)
+				goto fail;
+		}
 		goto done;
 	}
 	name += 5;

_


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new dev_t printable convention and lilo
  2003-08-13 20:24     ` Andrew Morton
@ 2003-08-14  5:05       ` "Andrey Borzenkov" 
  0 siblings, 0 replies; 5+ messages in thread
From: "Andrey Borzenkov"  @ 2003-08-14  5:05 UTC (permalink / raw)
  To: "Andrew Morton" ; +Cc: linux-kernel



[...]
> > it means handle-old-dev_t is meaningless and has to be removed ; and if we want people to use new format, it needs to go into name_to_dev_t.
> 
> It's better to handle both isn't it?
> 

is /sys/block/<name>/dev ever going to be in old format except if
due to a bug?


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-08-14  5:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-09 22:18 new dev_t printable convention and lilo Andrey Borzenkov
2003-08-09 23:12 ` Andrew Morton
2003-08-13 13:15   ` "Andrey Borzenkov" 
2003-08-13 20:24     ` Andrew Morton
2003-08-14  5:05       ` "Andrey Borzenkov" 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).