summaryrefslogtreecommitdiffstats
path: root/utils/mount/stropts.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2009-09-14 13:55:36 -0400
committerSteve Dickson <steved@redhat.com>2009-09-14 13:55:36 -0400
commit74badf6f30f7aea95e9d784244488084dbadcb55 (patch)
treeb9b51f825d68acfbfc16e1cc789c096a9a00d203 /utils/mount/stropts.c
parentb2a3cd590442309d40e9dd6d43213445df250694 (diff)
downloadnfs-utils-74badf6f30f7aea95e9d784244488084dbadcb55.tar.gz
nfs-utils-74badf6f30f7aea95e9d784244488084dbadcb55.tar.xz
nfs-utils-74badf6f30f7aea95e9d784244488084dbadcb55.zip
mount.nfs: Support "-t nfs,vers=4" mounts in the kernel
Support "vers=4" in nfs_nfs_version() Skip UMNT call for "-t nfs -o vers=4" mounts For "-t nfs -o vers=4" mounts, we want to skip v2/v3 version/transport negotiation, but be sure to append the "clientaddr" option. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com> Tested-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/mount/stropts.c')
-rw-r--r--utils/mount/stropts.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index a12ace7..3eb661e 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -84,6 +84,7 @@ struct nfsmount_info {
struct mount_options *options; /* parsed mount options */
char **extra_opts; /* string for /etc/mtab */
+ unsigned long version; /* NFS version */
int flags, /* MS_ flags */
fake, /* actually do the mount? */
child; /* forked bg child? */
@@ -272,7 +273,12 @@ static int nfs_validate_options(struct nfsmount_info *mi)
if (!nfs_name_to_address(mi->hostname, sap, &salen))
return 0;
- if (strncmp(mi->type, "nfs4", 4) == 0) {
+ if (!nfs_nfs_version(mi->options, &mi->version))
+ return 0;
+ if (strncmp(mi->type, "nfs4", 4) == 0)
+ mi->version = 4;
+
+ if (mi->version == 4) {
if (!nfs_append_clientaddr_option(sap, salen, mi->options))
return 0;
} else {
@@ -488,7 +494,7 @@ static int nfs_try_mount(struct nfsmount_info *mi)
char *options = NULL;
int result;
- if (strncmp(mi->type, "nfs4", 4) != 0) {
+ if (mi->version != 4) {
if (!nfs_rewrite_pmap_mount_options(mi->options))
return 0;
}