Linux NFS development
 help / color / mirror / Atom feed
From: Mi Jinlong <mijinlong@cn.fujitsu.com>
To: Steve Dickson <SteveD@redhat.com>
Cc: NFSv3 list <linux-nfs@vger.kernel.org>
Subject: [PATCH] mount: make sure mount correctly when kernel not support NFSv4
Date: Thu, 25 Nov 2010 13:54:43 +0800	[thread overview]
Message-ID: <4CEDFA23.5030103@cn.fujitsu.com> (raw)

When user's nfs client(kernel) don't support NFSv4, maybe they build
kernel without NFSv4, there is a problem.

When using command "mount SERVER-IP:/nfsv3 /mnt/" to mount NFSv3
filesystem, mount will fail and get error:

 "mount.nfs: an incorrect mount option was specified"

as above, the mount should success, but it fail.

When the mount command without specific NFS version, nfs-utils will
try to mount NFSv4 at first, but the kernel don't support, the kernel
will return with error EINVAL for parsing option (vers=4) fail.

nfs-utils should continue to try mounting NFSv3 when meeting that.

Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
---
 utils/mount/stropts.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 50a1a2a..e880c45 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -788,6 +788,10 @@ static int nfs_autonegotiate(struct nfsmount_info *mi)
 		/* Linux servers prior to 2.6.25 may return
 		 * EPERM when NFS version 4 is not supported. */
 		goto fall_back;
+	case EINVAL:
+		/* If Linux kernel don't support NFSv4, the EINVAL
+		 * will be return for parsing option (vers=4) fail. */
+		goto fall_back;
 	default:
 		return result;
 	}
-- 
1.7.3.2




             reply	other threads:[~2010-11-25  5:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25  5:54 Mi Jinlong [this message]
2010-11-29 14:40 ` [PATCH] mount: make sure mount correctly when kernel not support NFSv4 Chuck Lever
2010-11-30  6:54   ` Mi Jinlong
2010-11-30 15:13     ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CEDFA23.5030103@cn.fujitsu.com \
    --to=mijinlong@cn.fujitsu.com \
    --cc=SteveD@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox