new/yocto/meta-rockchip/recipes-kernel/linux/linux-rockchip_5.10/0001-init-do_mounts.c-Retry-all-fs-after-failed-to-mount-.patch

53 lines
1.5 KiB
Diff
Raw Normal View History

2025-05-10 21:58:58 +08:00
From cb45960e575e7c8c88744e09fda93c934cd1b1c1 Mon Sep 17 00:00:00 2001
From: Jeffy Chen <jeffy.chen@rock-chips.com>
Date: Fri, 9 Nov 2018 12:14:29 +0800
Subject: [PATCH 1/3] init/do_mounts.c: Retry all fs after failed to mount with
"rootfstype="
Retry all filesystems when failed to mount with specified ones.
Change-Id: Ic1b794cc61d61f1d0715e3b32400b3e96b0dddea
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
---
init/do_mounts.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/init/do_mounts.c b/init/do_mounts.c
index b5f9604d0c98..d85f60d79107 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -423,12 +423,13 @@ static int __init do_mount_root(const char *name, const char *fs,
return ret;
}
-void __init mount_block_root(char *name, int flags)
+void __init mount_block_root(char *name, int mountflags)
{
struct page *page = alloc_page(GFP_KERNEL);
char *fs_names = page_address(page);
char *p;
char b[BDEVNAME_SIZE];
+ int flags = mountflags;
scnprintf(b, BDEVNAME_SIZE, "unknown-block(%u,%u)",
MAJOR(ROOT_DEV), MINOR(ROOT_DEV));
@@ -464,6 +465,15 @@ void __init mount_block_root(char *name, int flags)
goto retry;
}
+ /* Retry all filesystems when failed to mount with specified ones */
+ if (root_fs_names) {
+ printk("Retrying all filesystems\n");
+ root_fs_names = NULL;
+ get_fs_names(fs_names);
+ flags = mountflags;
+ goto retry;
+ }
+
printk("List of all partitions:\n");
printk_all_partitions();
printk("No filesystem could mount root, tried: ");
--
2.20.1