NFS: Make NFS root work again
PATCH 1/1 NFS: Make NFS root work again
Make NFS root work by creating a "/root" directory to satisfy the mount, otherwise the path lookup for the mount fails with ENOENT.
---
init/do_mounts.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
init/do_mounts.c +4 -1
@@ -270,7 +270,10 @@ static void __init get_fs_names(char *page)static int __init do_mount_root (char *name,char *fs,int flags,void *data) { -int err =sys_mount (name,"/root" , fs, flags, data); +int err; + +sys_mkdir ("/root" ,0755 ); + err =sys_mount (name,"/root" , fs, flags, data);if (err)return err;
Quoted 14 lines · David Howells
Make NFS root work by creating a "/root" directory to satisfy the mount, otherwise the path lookup for the mount fails with ENOENT.
Signed-off-by David Howells <[email protected]>---
init/do_mounts.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)init/do_mounts.c +0
-0
init/do_mounts.c static void __init get_fs_names(char *page) · line 278
Quoted 10 lines
init/do_mounts.c +4
-1@@ -270,7 +270,10 @@ static void __init get_fs_names(char *page)static int __init do_mount_root (char *name,char *fs,int flags,void *data) { -int err =sys_mount (name,"/root" , fs, flags, data); +int err; + +sys_mkdir ("/root" ,0755 ); + err =sys_mount (name,"/root" , fs, flags, data);if (err)return err;
It seems to me that if sys_mkdir() fails with anything other other than EEXISTS, then sys_mount() will continue to fail. Is this something that we care about?
ps
Quoted 3 lines · On Thu, 07 Jun 2007 17:40:03 +0100 David Howells <[email protected]> wrote:
Make NFS root work by creating a "/root" directory to satisfy the mount, otherwise the path lookup for the mount fails with ENOENT.
What did we do to make it stop working, and when did we do it??
Quoted 17 lines
init/do_mounts.c +4
-1@@ -270,7 +270,10 @@ static void __init get_fs_names(char *page)static int __init do_mount_root (char *name,char *fs,int flags,void *data) { -int err =sys_mount (name,"/root" , fs, flags, data); +int err; + +sys_mkdir ("/root" ,0755 ); + err =sys_mount (name,"/root" , fs, flags, data);if (err)return err;
Quoted 14 lines · On Thu, 07 Jun 2007 17:40:03 +0100 David Howells <[email protected]> wrote:
Make NFS root work by creating a "/root" directory to satisfy the mount, otherwise the path lookup for the mount fails with ENOENT.
Signed-off-by David Howells <[email protected]>---
init/do_mounts.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)init/do_mounts.c +0
-0
init/do_mounts.c static void __init get_fs_names(char *page) · line 278
Quoted 10 lines
init/do_mounts.c +4
-1@@ -270,7 +270,10 @@ static void __init get_fs_names(char *page)static int __init do_mount_root (char *name,char *fs,int flags,void *data) { -int err =sys_mount (name,"/root" , fs, flags, data); +int err; + +sys_mkdir ("/root" ,0755 ); + err =sys_mount (name,"/root" , fs, flags, data);if (err)return err;
Am still awaiting a proper description of this patch, please.
What is not working, and how does this patch fix it?
I am unaware of any open bug reports against NFS root.
Quoted 29 lines · Andrew Morton
Quoted 14 lines · On Thu, 07 Jun 2007 17:40:03 +0100 David Howells <[email protected]> wrote:
Make NFS root work by creating a "/root" directory to satisfy the mount, otherwise the path lookup for the mount fails with ENOENT.
Signed-off-by David Howells <[email protected]>---
init/do_mounts.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)init/do_mounts.c +0
-0init/do_mounts.c static void __init get_fs_names(char *page) · line 278
Quoted 10 lines
init/do_mounts.c +4
-1@@ -270,7 +270,10 @@ static void __init get_fs_names(char *page)static int __init do_mount_root (char *name,char *fs,int flags,void *data) { -int err =sys_mount (name,"/root" , fs, flags, data); +int err; + +sys_mkdir ("/root" ,0755 ); + err =sys_mount (name,"/root" , fs, flags, data);if (err)return err;Am still awaiting a proper description of this patch, please.
Quoted 3 lines
What is not working, and how does this patch fix it?
I am unaware of any open bug reports against NFS root.
I'm confused too. We never used to require that the kernel create a special /root directory. What changed, and when?
Trond
Quoted 10 lines · Andrew Morton
Quoted 3 lines · On Thu, 07 Jun 2007 17:40:03 +0100 David Howells <[email protected]> wrote:
Make NFS root work by creating a "/root" directory to satisfy the mount, otherwise the path lookup for the mount fails with ENOENT.
Am still awaiting a proper description of this patch, please.
What is not working, and how does this patch fix it?
I am unaware of any open bug reports against NFS root.
I've not had any problems with it during any of the -rc periods, for what it's worth.
Quoted 2 lines · Andrew Morton
What is not working, and how does this patch fix it?
FWIW i use nfs root regularly for testing kernels and it works for me.
-Andi
Quoted 1 line · Andrew Morton
What is not working, and how does this patch fix it?
It turns out that this patch is unnecessary. The problem had to do with the initcalling of default_rootfs() (or lack of initcalling in this case). I fixed vmlinux.lds.S and it works now.
David