Skip to contentSkip to conversation

Regression: fix mounting NFS when NFSv3 support is not compiled

PATCH Superseded Paulius Zaleckas 2 participants 2 messages Oct 31, 2010

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---

 fs/nfs/super.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
fs/nfs/super.c +4 -0
index 0a42e8f..8737017 100644
@@ -2277,7 +2277,11 @@ static int nfs_get_sb(struct file_system_type *fs_type,
 	};
 	int error = -ENOMEM;
 
+#ifdef CONFIG_NFS_V3
 	data = nfs_alloc_parsed_mount_data(3);
+#else
+	data = nfs_alloc_parsed_mount_data(2);
+#endif
 	mntfh = nfs_alloc_fhandle();
 	if (data == NULL || mntfh == NULL)
 		goto out_free_fh;
#1 lore raw
Quoted 26 lines · Paulius Zaleckas

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

---

 fs/nfs/super.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
fs/nfs/super.c +0 -0
index 0a42e8f..8737017 100644
@@ -2277,7 +2277,11 @@ static int nfs_get_sb(struct file_system_type *fs_type,
 	};

fs/nfs/super.c static int nfs_get_sb(struct file_system_type *fs_type, · line 2287

Quoted 10 lines
fs/nfs/super.c +4 -0
 	int error = -ENOMEM;
 
+#ifdef CONFIG_NFS_V3
 	data = nfs_alloc_parsed_mount_data(3);
+#else
+	data = nfs_alloc_parsed_mount_data(2);
+#endif
 	mntfh = nfs_alloc_fhandle();
 	if (data == NULL || mntfh == NULL)
 		goto out_free_fh;

Let's do this as

#ifdef CONFIG_NFS_V3
#define NFS_DEFAULT_VERSION 3
#else
#define NFS_DEFAULT_VERSION 2
#endif

	data = nfs_alloc_parsed_mount_data(NFS_DEFAULT_VERSION);

instead.

Cheers
Trond