]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Regression: fix mounting NFS when NFSv3 support is not compiled
authorPaulius Zaleckas <paulius.zaleckas@gmail.com>
Sun, 31 Oct 2010 16:21:05 +0000 (18:21 +0200)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 16 Nov 2010 01:44:27 +0000 (20:44 -0500)
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: Paulius Zaleckas <paulius.zaleckas@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/super.c

index 0a42e8f4adcbc1723b57a7dac93c78b0a34b975e..9587506d493c320b36249de69495359f51d721c0 100644 (file)
 
 #define NFSDBG_FACILITY                NFSDBG_VFS
 
+#ifdef CONFIG_NFS_V3
+#define NFS_DEFAULT_VERSION 3
+#else
+#define NFS_DEFAULT_VERSION 2
+#endif
+
 enum {
        /* Mount options that take no arguments */
        Opt_soft, Opt_hard,
@@ -2277,7 +2283,7 @@ static int nfs_get_sb(struct file_system_type *fs_type,
        };
        int error = -ENOMEM;
 
-       data = nfs_alloc_parsed_mount_data(3);
+       data = nfs_alloc_parsed_mount_data(NFS_DEFAULT_VERSION);
        mntfh = nfs_alloc_fhandle();
        if (data == NULL || mntfh == NULL)
                goto out_free_fh;