All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Goldstein <cardoe@gentoo.org>
To: linux-hotplug@vger.kernel.org
Subject: Re: [PATCH] creating link /dev/root to device / is mounted from
Date: Sat, 21 Apr 2007 17:47:42 +0000	[thread overview]
Message-ID: <462A4E3E.3020708@gentoo.org> (raw)
In-Reply-To: <200704201246.21524.zzam@gentoo.org>


[-- Attachment #1.1.1: Type: text/plain, Size: 754 bytes --]

I honestly feel that this is a kernel issue. Since according to the
mount man page, /proc/mounts and /etc/mtab should be relatively in sync
and /etc/mtab can technically be a symlink of /proc/mounts. It states
that /proc/mounts should update quicker and as such should technically
be more reliable. Which I feel contradicts some people's opinions that
the kernel and /proc/mounts can not be trusted. I think this is bogus
because with an initramfs, the kernel does the right thing. Without one,
it hardcodes itself to /dev/root when the kernel knows via the root=
option what the proper dev node should be.

As a result, here's a kernel patch to correct this issue.


-- 
Doug Goldstein <cardoe@gentoo.org>
http://dev.gentoo.org/~cardoe/

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.1.2: dev-root-real-root.patch --]
[-- Type: text/x-patch; name="dev-root-real-root.patch", Size: 913 bytes --]

--- linux-2.6.20-gentoo-r6/init/do_mounts.c	2007-04-17 01:27:27.000000000 -0400
+++ linux-dev-root/init/do_mounts.c	2007-04-21 13:00:32.000000000 -0400
@@ -354,7 +354,10 @@
 	va_start(args, fmt);
 	vsprintf(buf, fmt, args);
 	va_end(args);
-	fd = sys_open("/dev/root", O_RDWR | O_NDELAY, 0);
+	if (saved_root_name[0])
+		fd = sys_open(saved_root_name, O_RDWR | O_NDELAY, 0);
+	else
+		fd = sys_open("/dev/root", O_RDWR | O_NDELAY, 0);
 	if (fd >= 0) {
 		sys_ioctl(fd, FDEJECT, 0);
 		sys_close(fd);
@@ -397,8 +400,13 @@
 	}
 #endif
 #ifdef CONFIG_BLOCK
-	create_dev("/dev/root", ROOT_DEV);
-	mount_block_root("/dev/root", root_mountflags);
+	if (saved_root_name[0]) {
+		create_dev(saved_root_name, ROOT_DEV);
+		mount_block_root(saved_root_name, root_mountflags);
+	} else {
+		create_dev("/dev/root", ROOT_DEV);
+		mount_block_root("/dev/root", root_mountflags);
+	}
 #endif
 }
 

[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

[-- Attachment #3: Type: text/plain, Size: 226 bytes --]

_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2007-04-21 17:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-20 10:46 [PATCH] creating link /dev/root to device / is mounted from Matthias Schwarzott
2007-04-20 14:55 ` Kay Sievers
2007-04-21  9:35 ` Matthias Schwarzott
2007-04-21 10:29 ` Andrey Borzenkov
2007-04-21 10:41 ` Kay Sievers
2007-04-21 13:31 ` Matthias Schwarzott
2007-04-21 17:47 ` Doug Goldstein [this message]
2007-04-22 12:01 ` Kay Sievers
2007-04-23 17:58 ` David Zeuthen
2007-04-24  9:37 ` Kay Sievers
2007-05-03  5:56 ` David Zeuthen

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=462A4E3E.3020708@gentoo.org \
    --to=cardoe@gentoo.org \
    --cc=linux-hotplug@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.