linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFS: Use the NFS_DEFAULT_VERSION for v2 and v3 mounts
@ 2012-06-08 15:32 bjschuma
  2012-06-08 16:00 ` Joerg Roedel
  0 siblings, 1 reply; 2+ messages in thread
From: bjschuma @ 2012-06-08 15:32 UTC (permalink / raw)
  To: Trond.Myklebust; +Cc: linux-nfs, joro, Bryan Schumaker

From: Bryan Schumaker <bjschuma@netapp.com>

Older versions of nfs utils don't always pass a "vers=" mount option for
NFS.  This chould lead to attempts at using NFS v0 due to a zeroed out
nfs_parsed_mount_data struct.  I solve this by setting the default NFS
version to NFS_DEFAULT_VERSION in the v2 and v3 cases (v4 has already been
taken care of by a similar patch).

Reported-by: Joerg Roedel <joro@&bytes.org>
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
---
 fs/nfs/super.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index ff656c0..97a3b30 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1867,6 +1867,7 @@ static int nfs23_validate_mount_data(void *options,
 	if (data == NULL)
 		goto out_no_data;
 
+	args->version = NFS_DEFAULT_VERSION;
 	switch (data->version) {
 	case 1:
 		data->namlen = 0;
-- 
1.7.10.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-06-08 16:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-08 15:32 [PATCH] NFS: Use the NFS_DEFAULT_VERSION for v2 and v3 mounts bjschuma
2012-06-08 16:00 ` Joerg Roedel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).