From: Daniel Drake <dsd@gentoo.org>
To: William Park <opengeometry@yahoo.ca>
Cc: lkml <linux-kernel@vger.kernel.org>, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH] Wait and retry mounting root device
Date: Wed, 05 Jan 2005 01:17:08 +0000 [thread overview]
Message-ID: <41DB4014.6070308@gentoo.org> (raw)
In-Reply-To: <20050104221600.GA2619@node1.opengeometry.net>
[-- Attachment #1: Type: text/plain, Size: 527 bytes --]
Hi William,
William Park wrote:
> It's funny... Your patch does the opposite. It works for
> root=/dev/sda1
> from the kernel command line, but not from Lilo or 'root=8:1' on command
> line. :-)
Ah, yes :/
I found a simpler way to do it (but I'm not sure if it is 'clean' enough).
I've attached an incremental patch against your first patch. This works with
root=8:1 and root=/dev/sda1 for me.
Andrew, how does this look? I've also attached the new full patch so that you
can also see the context.
Thanks,
Daniel
[-- Attachment #2: incremental.patch --]
[-- Type: text/x-patch, Size: 650 bytes --]
Applies on top of William Park's wait/retry mounting root device patch.
Allows usage of "root=/dev/sda1" style arguments, which was not possible
in the first version.
Signed-off-by: Daniel Drake <dsd@gentoo.org>
--- linux-2.6.10/init/do_mounts.c 2005-01-05 01:03:47.165499144 +0000
+++ linux-dsd/init/do_mounts.c 2005-01-05 01:04:19.001659312 +0000
@@ -283,6 +283,10 @@
get_fs_names(fs_names);
retry:
+ if (!ROOT_DEV) {
+ ROOT_DEV = name_to_dev_t(saved_root_name);
+ create_dev(name, ROOT_DEV, root_device_name);
+ }
for (p = fs_names; *p; p += strlen(p)+1) {
int err = do_mount_root(name, p, flags, root_mount_data);
switch (err) {
[-- Attachment #3: full.patch --]
[-- Type: text/x-patch, Size: 1573 bytes --]
Retry up to 20 times if mounting the root device fails.
This fixes booting from usb-storage devices, which no longer
make their partitions immediately available.
From: William Park <opengeometry@yahoo.ca>
Signed-off-by: Daniel Drake <dsd@gentoo.org>
--- linux-2.6.10/init/do_mounts.c 2005-01-05 01:11:25.118879648 +0000
+++ linux-dsd/init/do_mounts.c 2005-01-05 01:04:19.001659312 +0000
@@ -6,6 +6,7 @@
#include <linux/suspend.h>
#include <linux/root_dev.h>
#include <linux/security.h>
+#include <linux/delay.h>
#include <linux/nfs_fs.h>
#include <linux/nfs_fs_sb.h>
@@ -278,9 +279,14 @@
char *fs_names = __getname();
char *p;
char b[BDEVNAME_SIZE];
+ int tryagain = 20;
get_fs_names(fs_names);
retry:
+ if (!ROOT_DEV) {
+ ROOT_DEV = name_to_dev_t(saved_root_name);
+ create_dev(name, ROOT_DEV, root_device_name);
+ }
for (p = fs_names; *p; p += strlen(p)+1) {
int err = do_mount_root(name, p, flags, root_mount_data);
switch (err) {
@@ -297,9 +303,13 @@
* and bad superblock on root device.
*/
__bdevname(ROOT_DEV, b);
- printk("VFS: Cannot open root device \"%s\" or %s\n",
- root_device_name, b);
- printk("Please append a correct \"root=\" boot option\n");
+ if (--tryagain) {
+ printk (KERN_WARNING "VFS: Waiting %dsec for root device...\n", tryagain);
+ ssleep (1);
+ goto retry;
+ }
+ printk (KERN_CRIT "VFS: Cannot open root device \"%s\" or %s\n", root_device_name, b);
+ printk (KERN_CRIT "Please append a correct \"root=\" boot option\n");
panic("VFS: Unable to mount root fs on %s", b);
}
prev parent reply other threads:[~2005-01-05 0:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-04 12:37 [PATCH] Wait and retry mounting root device Daniel Drake
2005-01-04 22:16 ` William Park
2005-01-05 1:17 ` Daniel Drake [this message]
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=41DB4014.6070308@gentoo.org \
--to=dsd@gentoo.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=opengeometry@yahoo.ca \
/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.