+ init-do_mountsc-create-root-if-it-does-not-exist.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: init/do_mounts.c: create /root if it does not exist
has been added to the -mm tree.  Its filename is
     init-do_mountsc-create-root-if-it-does-not-exist.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
From: YanHong <tempname2@xxxxxxxxxxx>
Subject: init/do_mounts.c: create /root if it does not exist

If someone supplies an initramfs without /root in it, and we fail to
execute rdinit, we will try to mount root device and fail, for the mount
point does not exits.

But we get error message "VFS: Cannot open root device".  It's confusing.

We can give a more detailed error message, or we can go further: if /root
does not exit, create it.

Signed-off-by: YanHong <tempname2@xxxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 init/do_mounts.c |    3 +++
 1 file changed, 3 insertions(+)

diff -puN init/do_mounts.c~init-do_mountsc-create-root-if-it-does-not-exist init/do_mounts.c
--- a/init/do_mounts.c~init-do_mountsc-create-root-if-it-does-not-exist
+++ a/init/do_mounts.c
@@ -350,6 +350,9 @@ void __init mount_block_root(char *name,
 	const char *b = name;
 #endif
 
+	if (sys_access((const char __user *) "/root", 0) != 0)
+		sys_mkdir((const char __user *) "/root", 0700);
+
 	get_fs_names(fs_names);
 retry:
 	for (p = fs_names; *p; p += strlen(p)+1) {
_
Subject: Subject: init/do_mounts.c: create /root if it does not exist

Patches currently in -mm which might be from tempname2@xxxxxxxxxxx are

init-do_mountsc-create-root-if-it-does-not-exist.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux