All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mount: make sure mount correctly when kernel not support NFSv4
@ 2010-11-25  5:54 Mi Jinlong
  2010-11-29 14:40 ` Chuck Lever
  0 siblings, 1 reply; 4+ messages in thread
From: Mi Jinlong @ 2010-11-25  5:54 UTC (permalink / raw)
  To: Steve Dickson; +Cc: NFSv3 list

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




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

end of thread, other threads:[~2010-11-30 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-25  5:54 [PATCH] mount: make sure mount correctly when kernel not support NFSv4 Mi Jinlong
2010-11-29 14:40 ` Chuck Lever
2010-11-30  6:54   ` Mi Jinlong
2010-11-30 15:13     ` Chuck Lever

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.