提交 1e657bd5 编写于 作者: P Paulius Zaleckas 提交者: Trond Myklebust

Regression: fix mounting NFS when NFSv3 support is not compiled

Trying to mount NFS (root partition in my case) fails if CONFIG_NFS_V3
is not selected. nfs_validate_mount_data() returns EPROTONOSUPPORT,
because of this check:

#ifndef CONFIG_NFS_V3
	if (args->version == 3)
		goto out_v3_not_compiled;
#endif /* !CONFIG_NFS_V3 */

and args->version was always initialized to 3.

It was working in 2.6.36
Signed-off-by: NPaulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 8e35f8e7
...@@ -67,6 +67,12 @@ ...@@ -67,6 +67,12 @@
#define NFSDBG_FACILITY NFSDBG_VFS #define NFSDBG_FACILITY NFSDBG_VFS
#ifdef CONFIG_NFS_V3
#define NFS_DEFAULT_VERSION 3
#else
#define NFS_DEFAULT_VERSION 2
#endif
enum { enum {
/* Mount options that take no arguments */ /* Mount options that take no arguments */
Opt_soft, Opt_hard, Opt_soft, Opt_hard,
...@@ -2277,7 +2283,7 @@ static int nfs_get_sb(struct file_system_type *fs_type, ...@@ -2277,7 +2283,7 @@ static int nfs_get_sb(struct file_system_type *fs_type,
}; };
int error = -ENOMEM; int error = -ENOMEM;
data = nfs_alloc_parsed_mount_data(3); data = nfs_alloc_parsed_mount_data(NFS_DEFAULT_VERSION);
mntfh = nfs_alloc_fhandle(); mntfh = nfs_alloc_fhandle();
if (data == NULL || mntfh == NULL) if (data == NULL || mntfh == NULL)
goto out_free_fh; goto out_free_fh;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册