summaryrefslogtreecommitdiff
path: root/init/do_mounts.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2023-05-31 15:55:20 +0300
committerJens Axboe <axboe@kernel.dk>2023-06-05 19:55:20 +0300
commit73231b58b1b496d631fa0ecf9fa7f64f5a07c6e3 (patch)
tree98de3f034dacd8f1b66df8f95abe7f9cadb96bcc /init/do_mounts.c
parentc8643c72bc42781fc169c6498a3902bec447099e (diff)
downloadlinux-73231b58b1b496d631fa0ecf9fa7f64f5a07c6e3.tar.xz
init: don't remove the /dev/ prefix from error messages
Remove the code that drops the /dev/ prefix from root_device_name, which is only used for error messages when mounting the root device fails. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20230531125535.676098-10-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'init/do_mounts.c')
-rw-r--r--init/do_mounts.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 1405ee7218bf..74cc96bffbdd 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -607,8 +607,6 @@ void __init mount_root(char *root_device_name)
*/
void __init prepare_namespace(void)
{
- char *root_device_name;
-
if (root_delay) {
printk(KERN_INFO "Waiting %d sec before mounting root device...\n",
root_delay);
@@ -627,19 +625,16 @@ void __init prepare_namespace(void)
md_run_setup();
if (saved_root_name[0]) {
- root_device_name = saved_root_name;
- if (!strncmp(root_device_name, "mtd", 3) ||
- !strncmp(root_device_name, "ubi", 3)) {
- mount_root_generic(root_device_name, root_device_name,
+ if (!strncmp(saved_root_name, "mtd", 3) ||
+ !strncmp(saved_root_name, "ubi", 3)) {
+ mount_root_generic(saved_root_name, saved_root_name,
root_mountflags);
goto out;
}
- ROOT_DEV = name_to_dev_t(root_device_name);
- if (strncmp(root_device_name, "/dev/", 5) == 0)
- root_device_name += 5;
+ ROOT_DEV = name_to_dev_t(saved_root_name);
}
- if (initrd_load(root_device_name))
+ if (initrd_load(saved_root_name))
goto out;
/* wait for any asynchronous scanning to complete */
@@ -652,7 +647,7 @@ void __init prepare_namespace(void)
async_synchronize_full();
}
- mount_root(root_device_name);
+ mount_root(saved_root_name);
out:
devtmpfs_mount();
init_mount(".", "/", NULL, MS_MOVE, NULL);