linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.4.19 breaks devfs mapping for root=
@ 2002-10-16 11:03 Keith Owens
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Owens @ 2002-10-16 11:03 UTC (permalink / raw)
  To: linux-kernel; +Cc: rgooch, viro

Resend #1 - no response to original.

A change from 2.4.18 to 2.4.19 has broken the way that devfs maps
root=.  2.4.18 init/main.c::mount_root() has

        devfs_make_root (root_device_name);
        handle = devfs_find_handle (NULL, ROOT_DEVICE_NAME,
                                    MAJOR (ROOT_DEV), MINOR (ROOT_DEV),
                                    DEVFS_SPECIAL_BLK, 1);

where ROOT_DEVICE_NAME maps to the value of root= for non-initrd.  This
allowed devfs to remap an entry such as sda3 to whatever driver was
implementing sda3, even if that driver used a different major number.
The correct major was returned in handle.

2.4.19 init/do_mounts.c::mount_root() has

        devfs_make_root(root_device_name);
        create_dev("/dev/root", ROOT_DEV, root_device_name);

create_dev() has

	handle = devfs_find_handle(NULL, dev ? NULL : devfs_name,
                    MAJOR(dev), MINOR(dev), DEVFS_SPECIAL_BLK, 1);

The difference in 2.4.19 is that if dev is already set from
root_dev_names[] then devfs does NOT get the value of root=, forcing
the use of major from root_dev_names[].  If a driver reimplements one
of the standard device names and uses a different major or minor number
then it no longer works in 2.4.19 because devfs is given incomplete
information.

Quick and dirty workaround

--- 2.4.19/init/do_mounts.c
+++ 2.4.19/init/do_mounts.c
@@ -368,7 +368,7 @@
 	if (!do_devfs)
 		return sys_mknod(name, S_IFBLK|0600, kdev_t_to_nr(dev));
 
-	handle = devfs_find_handle(NULL, dev ? NULL : devfs_name,
+	handle = devfs_find_handle(NULL, devfs_name,
 				MAJOR(dev), MINOR(dev), DEVFS_SPECIAL_BLK, 1);
 	if (!handle)
 		return -1;

But that probably breaks initrd.  What should that code be doing to
cope with both initrd and still allow devfs to remap root=?


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

* 2.4.19 breaks devfs mapping for root=
@ 2002-10-21 11:02 Keith Owens
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Owens @ 2002-10-21 11:02 UTC (permalink / raw)
  To: linux-kernel; +Cc: rgooch, viro

Resend #2 - no response to previous mails.

A change from 2.4.18 to 2.4.19 has broken the way that devfs maps
root=.  2.4.18 init/main.c::mount_root() has

        devfs_make_root (root_device_name);
        handle = devfs_find_handle (NULL, ROOT_DEVICE_NAME,
                                    MAJOR (ROOT_DEV), MINOR (ROOT_DEV),
                                    DEVFS_SPECIAL_BLK, 1);

where ROOT_DEVICE_NAME maps to the value of root= for non-initrd.  This
allowed devfs to remap an entry such as sda3 to whatever driver was
implementing sda3, even if that driver used a different major number.
The correct major was returned in handle.

2.4.19 init/do_mounts.c::mount_root() has

        devfs_make_root(root_device_name);
        create_dev("/dev/root", ROOT_DEV, root_device_name);

create_dev() has

	handle = devfs_find_handle(NULL, dev ? NULL : devfs_name,
                    MAJOR(dev), MINOR(dev), DEVFS_SPECIAL_BLK, 1);

The difference in 2.4.19 is that if dev is already set from
root_dev_names[] then devfs does NOT get the value of root=, forcing
the use of major from root_dev_names[].  If a driver reimplements one
of the standard device names and uses a different major or minor number
then it no longer works in 2.4.19 because devfs is given incomplete
information.

Quick and dirty workaround

--- 2.4.19/init/do_mounts.c
+++ 2.4.19/init/do_mounts.c
@@ -368,7 +368,7 @@
 	if (!do_devfs)
 		return sys_mknod(name, S_IFBLK|0600, kdev_t_to_nr(dev));
 
-	handle = devfs_find_handle(NULL, dev ? NULL : devfs_name,
+	handle = devfs_find_handle(NULL, devfs_name,
 				MAJOR(dev), MINOR(dev), DEVFS_SPECIAL_BLK, 1);
 	if (!handle)
 		return -1;

But that probably breaks initrd.  What should that code be doing to
cope with both initrd and still allow devfs to remap root=?


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

* 2.4.19 breaks devfs mapping for root=
@ 2002-10-14  6:26 Keith Owens
  0 siblings, 0 replies; 3+ messages in thread
From: Keith Owens @ 2002-10-14  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: rgooch, viro

A change from 2.4.18 to 2.4.19 has broken the way that devfs maps
root=.  2.4.18 init/main.c::mount_root() has

        devfs_make_root (root_device_name);
        handle = devfs_find_handle (NULL, ROOT_DEVICE_NAME,
                                    MAJOR (ROOT_DEV), MINOR (ROOT_DEV),
                                    DEVFS_SPECIAL_BLK, 1);

where ROOT_DEVICE_NAME maps to the value of root= for non-initrd.  This
allowed devfs to remap an entry such as sda3 to whatever driver was
implementing sda3, even if that driver used a different major number.
The correct major was returned in handle.

2.4.19 init/do_mounts.c::mount_root() has

        devfs_make_root(root_device_name);
        create_dev("/dev/root", ROOT_DEV, root_device_name);

create_dev() has

	handle = devfs_find_handle(NULL, dev ? NULL : devfs_name,
                    MAJOR(dev), MINOR(dev), DEVFS_SPECIAL_BLK, 1);

The difference in 2.4.19 is that if dev is already set from
root_dev_names[] then devfs does NOT get the value of root=, forcing
the use of major from root_dev_names[].  If a driver reimplements one
of the standard device names and uses a different major or minor number
then it no longer works in 2.4.19 because devfs is given incomplete
information.

Quick and dirty workaround

--- 2.4.19/init/do_mounts.c
+++ 2.4.19/init/do_mounts.c
@@ -368,7 +368,7 @@
 	if (!do_devfs)
 		return sys_mknod(name, S_IFBLK|0600, kdev_t_to_nr(dev));
 
-	handle = devfs_find_handle(NULL, dev ? NULL : devfs_name,
+	handle = devfs_find_handle(NULL, devfs_name,
 				MAJOR(dev), MINOR(dev), DEVFS_SPECIAL_BLK, 1);
 	if (!handle)
 		return -1;

But that probably breaks initrd.  What should that code be doing to
cope with both initrd and still allow devfs to remap root=?


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

end of thread, other threads:[~2002-10-21 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-16 11:03 2.4.19 breaks devfs mapping for root= Keith Owens
  -- strict thread matches above, loose matches on Subject: below --
2002-10-21 11:02 Keith Owens
2002-10-14  6:26 Keith Owens

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).