init/do_mounts.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/init/do_mounts.c b/init/do_mounts.c index 82f22885c87e..a6a725f46f18 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c @@ -385,6 +385,7 @@ void __init mount_block_root(char *name, int flags) #else const char *b = name; #endif + int last_err = 0; get_fs_names(fs_names); retry: @@ -394,29 +395,16 @@ retry: case 0: goto out; case -EACCES: + if (flags & MS_RDONLY) + break; flags |= MS_RDONLY; goto retry; case -EINVAL: continue; } - /* - * Allow the user to distinguish between failed sys_open - * and bad superblock on root device. - * and give them a list of the available devices - */ -#ifdef CONFIG_BLOCK - __bdevname(ROOT_DEV, b); -#endif - printk("VFS: Cannot open root device \"%s\" or %s: error %d\n", - root_device_name, b, err); - printk("Please append a correct \"root=\" boot option; here are the available partitions:\n"); - - printk_all_partitions(); -#ifdef CONFIG_DEBUG_BLOCK_EXT_DEVT - printk("DEBUG_BLOCK_EXT_DEVT is enabled, you need to specify " - "explicit textual name for \"root=\" boot option.\n"); -#endif - panic("VFS: Unable to mount root fs on %s", b); + if (err != last_err) + printk("VFS: Cannot open root device \"%s\" or %s: error %d\n", + root_device_name, b, err); } printk("List of all partitions:\n");