|
|
64c563 |
diff -up nfs-utils-1.3.0/utils/mount/stropts.c.orig nfs-utils-1.3.0/utils/mount/stropts.c
|
|
|
64c563 |
--- nfs-utils-1.3.0/utils/mount/stropts.c.orig 2017-06-01 11:24:19.925018714 -0400
|
|
|
64c563 |
+++ nfs-utils-1.3.0/utils/mount/stropts.c 2017-06-01 11:25:20.033023121 -0400
|
|
|
64c563 |
@@ -313,9 +313,10 @@ static int nfs_set_version(struct nfsmou
|
|
|
64c563 |
if (!nfs_nfs_version(mi->options, &mi->version))
|
|
|
64c563 |
return 0;
|
|
|
64c563 |
|
|
|
64c563 |
- if (strncmp(mi->type, "nfs4", 4) == 0)
|
|
|
64c563 |
+ if (strncmp(mi->type, "nfs4", 4) == 0) {
|
|
|
64c563 |
mi->version.major = 4;
|
|
|
64c563 |
-
|
|
|
64c563 |
+ mi->version.v_mode = V_GENERAL;
|
|
|
64c563 |
+ }
|
|
|
64c563 |
/*
|
|
|
64c563 |
* Before 2.6.32, the kernel NFS client didn't
|
|
|
64c563 |
* support "-t nfs vers=4" mounts, so NFS version
|
|
|
64c563 |
@@ -856,9 +857,6 @@ check_result:
|
|
|
64c563 |
case EINVAL:
|
|
|
64c563 |
/* A less clear indication that our client
|
|
|
64c563 |
* does not support NFSv4 minor version. */
|
|
|
64c563 |
- if (mi->version.v_mode == V_GENERAL &&
|
|
|
64c563 |
- mi->version.minor == 0)
|
|
|
64c563 |
- return result;
|
|
|
64c563 |
if (mi->version.v_mode != V_SPECIFIC) {
|
|
|
64c563 |
if (mi->version.minor > 0) {
|
|
|
64c563 |
mi->version.minor--;
|
|
|
64c563 |
@@ -880,6 +878,9 @@ check_result:
|
|
|
64c563 |
/* UDP-Only servers won't support v4, but maybe it
|
|
|
64c563 |
* just isn't ready yet. So try v3, but double-check
|
|
|
64c563 |
* with rpcbind for v4. */
|
|
|
64c563 |
+ if (mi->version.v_mode == V_GENERAL)
|
|
|
64c563 |
+ /* Mustn't try v2,v3 */
|
|
|
64c563 |
+ return result;
|
|
|
64c563 |
result = nfs_try_mount_v3v2(mi, TRUE);
|
|
|
64c563 |
if (result == 0 && errno == EAGAIN) {
|
|
|
64c563 |
/* v4 server seems to be registered now. */
|
|
|
64c563 |
@@ -893,6 +894,9 @@ check_result:
|
|
|
64c563 |
}
|
|
|
64c563 |
|
|
|
64c563 |
fall_back:
|
|
|
64c563 |
+ if (mi->version.v_mode == V_GENERAL)
|
|
|
64c563 |
+ /* v2,3 fallback not allowed */
|
|
|
64c563 |
+ return result;
|
|
|
64c563 |
return nfs_try_mount_v3v2(mi, FALSE);
|
|
|
64c563 |
}
|
|
|
64c563 |
|