mount.nfs: Teach mount.nfs about the mountversion option
Subsystems (2)
PATCH 1/1 mount.nfs: Teach mount.nfs about the mountversion option
When the mountversion option is used, there should not be any mount negotiations with the server.
Also, when the option is used, its know that the mount is a v4 mount and a V_SPECFIC type.
--- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
utils/mount/network.c +6 -1
@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {"v4" ,"vers" ,"nfsvers" , +"minorversion" , NULL, };
@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)if (!(version->major =strtol (version_val, &cptr,10 ))) goto ret_error; -if (version->major <4 ) +if (strcmp (nfs_version_opttbl[i],"minorversion" ) ==0 ) { + version->v_mode =V_SPECIFIC ; + version->minor = version->major; + version->major =4 ; + }else if (version->major <4 ) version->v_mode =V_SPECIFIC ;if (*cptr =='.' ) {
Signature · 1 line
2.4.3
Quoted 27 lines · Steve Dickson
When the mountversion option is used, there should not be any mount negotiations with the server.
Also, when the option is used, its know that the mount is a v4 mount and a
V_SPECFICtype.Signed-off-by Steve Dickson <[email protected]>--- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)utils/mount/network.c +1
-0@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {"v4" ,"vers" ,"nfsvers" , +"minorversion" , NULL, };@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)if (!(version->major =strtol (version_val, &cptr,10 ))) goto ret_error;
utils/mount/network.c nfs_nfs_version(struct mount_options *options, struct nfs_version *version) · line 1283
Quoted 10 lines
utils/mount/network.c +5
-1-if (version->major <4 ) +if (strcmp (nfs_version_opttbl[i],"minorversion" ) ==0 ) { + version->v_mode =V_SPECIFIC ; + version->minor = version->major; + version->major =4 ; + }else if (version->major <4 ) version->v_mode =V_SPECIFIC ;if (*cptr =='.' ) {
Doesn't this cause a dependency on the ordering of 'nfsvers'/'vers' and 'minorversion' in your mount options string?
Cheers
Trond
Quoted 36 lines · Trond Myklebust
Quoted 35 lines · Steve Dickson
When the mountversion option is used, there should not be any mount negotiations with the server.
Also, when the option is used, its know that the mount is a v4 mount and a
V_SPECFICtype.Signed-off-by Steve Dickson <[email protected]>--- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)utils/mount/network.c +6
-1@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {"v4" ,"vers" ,"nfsvers" , +"minorversion" , NULL, };@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)if (!(version->major =strtol (version_val, &cptr,10 ))) goto ret_error; -if (version->major <4 ) +if (strcmp (nfs_version_opttbl[i],"minorversion" ) ==0 ) { + version->v_mode =V_SPECIFIC ; + version->minor = version->major; + version->major =4 ; + }else if (version->major <4 ) version->v_mode =V_SPECIFIC ;
Quoted 5 lines
utils/mount/network.c nfs_nfs_version(struct mount_options *options, struct nfs_version *version) · line 1283
Quoted 2 lines
utils/mount/network.c +0
-0if (*cptr =='.' ) {Doesn't this cause a dependency on the ordering of 'nfsvers'/'vers' and 'minorversion' in your mount options string?
I don't think so... The only combination that does not work is -o nfsvers=3,minorversion=1 which should fail...
What am I missing?
steved.
Quoted 44 lines · Steve Dickson
Quoted 36 lines · Trond Myklebust
Quoted 35 lines · Steve Dickson
When the mountversion option is used, there should not be any mount negotiations with the server.
Also, when the option is used, its know that the mount is a v4 mount and a
V_SPECFICtype.Signed-off-by Steve Dickson <[email protected]>--- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)utils/mount/network.c +6
-1@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {"v4" ,"vers" ,"nfsvers" , +"minorversion" , NULL, };@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)if (!(version->major =strtol (version_val, &cptr,10 ))) goto ret_error; -if (version->major <4 ) +if (strcmp (nfs_version_opttbl[i],"minorversion" ) ==0 ) { + version->v_mode =V_SPECIFIC ; + version->minor = version->major; + version->major =4 ; + }else if (version->major <4 ) version->v_mode =V_SPECIFIC ;Quoted 5 lines
utils/mount/network.c nfs_nfs_version(struct mount_options *options, struct nfs_version *version) · line 1283
Quoted 2 lines
utils/mount/network.c +0
-0if (*cptr =='.' ) {Doesn't this cause a dependency on the ordering of 'nfsvers'/'vers' and 'minorversion' in your mount options string?
Quoted 5 lines
I don't think so... The only combination that does not work is -o nfsvers=3,minorversion=1 which should fail...
What am I missing?
Does "-o minorversion=1,nfsvers=3" show the same behaviour?
Cheers
Trond
Quoted 45 lines · Trond Myklebust
Quoted 44 lines · Steve Dickson
Quoted 41 lines · Trond Myklebust
Quoted 27 lines · Steve Dickson
When the mountversion option is used, there should not be any mount negotiations with the server.
Also, when the option is used, its know that the mount is a v4 mount and a
V_SPECFICtype.Signed-off-by Steve Dickson <[email protected]>--- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)utils/mount/network.c +1
-0@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {"v4" ,"vers" ,"nfsvers" , +"minorversion" , NULL, };@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)if (!(version->major =strtol (version_val, &cptr,10 ))) goto ret_error;utils/mount/network.c nfs_nfs_version(struct mount_options *options, struct nfs_version *version) · line 1283
Quoted 10 lines
utils/mount/network.c +5
-1-if (version->major <4 ) +if (strcmp (nfs_version_opttbl[i],"minorversion" ) ==0 ) { + version->v_mode =V_SPECIFIC ; + version->minor = version->major; + version->major =4 ; + }else if (version->major <4 ) version->v_mode =V_SPECIFIC ;if (*cptr =='.' ) {Doesn't this cause a dependency on the ordering of 'nfsvers'/'vers' and 'minorversion' in your mount options string?
Quoted 7 lines
Quoted 5 lines
I don't think so... The only combination that does not work is -o nfsvers=3,minorversion=1 which should fail...
What am I missing?
Does "-o minorversion=1,nfsvers=3" show the same behaviour?
It does
# mount.nfs -o minorversion=1,nfsvers=3 freddy:/home /mnt/home mount.nfs: an incorrect mount option was specified
Plus a nice little error message comes out on the console
NFS: mount option vers=3 does not support minorversion=1
And -o minorversion=0,nfsvers=3 works as expected...
steved.
Quoted 4 lines
Cheers
Trond
Quoted 36 lines · Trond Myklebust
Quoted 35 lines · Steve Dickson
When the mountversion option is used, there should not be any mount negotiations with the server.
Also, when the option is used, its know that the mount is a v4 mount and a
V_SPECFICtype.Signed-off-by Steve Dickson <[email protected]>--- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)utils/mount/network.c +6
-1@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {"v4" ,"vers" ,"nfsvers" , +"minorversion" , NULL, };@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)if (!(version->major =strtol (version_val, &cptr,10 ))) goto ret_error; -if (version->major <4 ) +if (strcmp (nfs_version_opttbl[i],"minorversion" ) ==0 ) { + version->v_mode =V_SPECIFIC ; + version->minor = version->major; + version->major =4 ; + }else if (version->major <4 ) version->v_mode =V_SPECIFIC ;
Quoted 5 lines
utils/mount/network.c nfs_nfs_version(struct mount_options *options, struct nfs_version *version) · line 1283
Quoted 2 lines
utils/mount/network.c +0
-0if (*cptr =='.' ) {Doesn't this cause a dependency on the ordering of 'nfsvers'/'vers' and 'minorversion' in your mount options string?
Without this patch, there is a dependency on the ordering now. mount with "-o minorversion=1", nfs gets strings as "minorversion=1,vers=4.2"
If nfs-utils doesn't parse minorversion, the order dependency also exist.
I agree with parsing minorversion in nfs-utils.
thanks,
Kinglong Mee
Quoted 43 lines · Kinglong Mee
Quoted 36 lines · Trond Myklebust
Quoted 35 lines · Steve Dickson
When the mountversion option is used, there should not be any mount negotiations with the server.
Also, when the option is used, its know that the mount is a v4 mount and a
V_SPECFICtype.Signed-off-by Steve Dickson <[email protected]>--- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)utils/mount/network.c +6
-1@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {"v4" ,"vers" ,"nfsvers" , +"minorversion" , NULL, };@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)if (!(version->major =strtol (version_val, &cptr,10 ))) goto ret_error; -if (version->major <4 ) +if (strcmp (nfs_version_opttbl[i],"minorversion" ) ==0 ) { + version->v_mode =V_SPECIFIC ; + version->minor = version->major; + version->major =4 ; + }else if (version->major <4 ) version->v_mode =V_SPECIFIC ;Quoted 5 lines
utils/mount/network.c nfs_nfs_version(struct mount_options *options, struct nfs_version *version) · line 1283
Quoted 2 lines
utils/mount/network.c +0
-0if (*cptr =='.' ) {Doesn't this cause a dependency on the ordering of 'nfsvers'/'vers' and 'minorversion' in your mount options string?
Quoted 7 lines
Without this patch, there is a dependency on the ordering now. mount with "-o minorversion=1", nfs gets strings as "minorversion=1,vers=4.2"
If nfs-utils doesn't parse minorversion, the order dependency also exist.
I agree with parsing minorversion in nfs-utils.
I was rather hoping we could get rid of 'minorversion' soon. It is a wart, and we've already agreed to deprecate it.
Trond
Quoted 47 lines · Trond Myklebust
Quoted 46 lines · Kinglong Mee
Quoted 36 lines · Trond Myklebust
Quoted 35 lines · Steve Dickson
When the mountversion option is used, there should not be any mount negotiations with the server.
Also, when the option is used, its know that the mount is a v4 mount and a
V_SPECFICtype.Signed-off-by Steve Dickson <[email protected]>--- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)utils/mount/network.c +6
-1@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {"v4" ,"vers" ,"nfsvers" , +"minorversion" , NULL, };@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)if (!(version->major =strtol (version_val, &cptr,10 ))) goto ret_error; -if (version->major <4 ) +if (strcmp (nfs_version_opttbl[i],"minorversion" ) ==0 ) { + version->v_mode =V_SPECIFIC ; + version->minor = version->major; + version->major =4 ; + }else if (version->major <4 ) version->v_mode =V_SPECIFIC ;Quoted 5 lines
utils/mount/network.c nfs_nfs_version(struct mount_options *options, struct nfs_version *version) · line 1283
Quoted 2 lines
utils/mount/network.c +0
-0if (*cptr =='.' ) {Doesn't this cause a dependency on the ordering of 'nfsvers'/'vers' and 'minorversion' in your mount options string?
Without this patch, there is a dependency on the ordering now. mount with "-o minorversion=1", nfs gets strings as "minorversion=1,vers=4.2"
Quoted 7 lines
Quoted 4 lines
If nfs-utils doesn't parse minorversion, the order dependency also exist.
I agree with parsing minorversion in nfs-utils.
I was rather hoping we could get rid of 'minorversion' soon. It is a wart, and we've already agreed to deprecate it.
I agree with the deprecation, but I think that is a different issue...
steved.
Quoted 10 lines · Steve Dickson
When the mountversion option is used, there should not be any mount negotiations with the server.
Also, when the option is used, its know that the mount is a v4 mount and a
V_SPECFICtype.Signed-off-by Steve Dickson <[email protected]>--- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
Wow... this slide through the cracks... I still think its a good idea so with no objection I'm planning on committing this...
So take solace in the fact it takes awhile for my own patches to get in! ;-)
steved.
Quoted 27 lines
utils/mount/network.c +6
-1@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {"v4" ,"vers" ,"nfsvers" , +"minorversion" , NULL, };@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)if (!(version->major =strtol (version_val, &cptr,10 ))) goto ret_error; -if (version->major <4 ) +if (strcmp (nfs_version_opttbl[i],"minorversion" ) ==0 ) { + version->v_mode =V_SPECIFIC ; + version->minor = version->major; + version->major =4 ; + }else if (version->major <4 ) version->v_mode =V_SPECIFIC ;if (*cptr =='.' ) {
Quoted 7 lines · Steve Dickson
When the mountversion option is used, there should not be any mount negotiations with the server.
Also, when the option is used, its know that the mount is a v4 mount and a
V_SPECFICtype.Signed-off-by Steve Dickson <[email protected]>
Committed..
steved.
Quoted 30 lines
--- utils/mount/network.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)utils/mount/network.c +6
-1@@ -92,6 +92,7 @@ static const char *nfs_version_opttbl[] = {"v4" ,"vers" ,"nfsvers" , +"minorversion" , NULL, };@@ -1272,7 +1273,11 @@ nfs_nfs_version(struct mount_options *options, struct nfs_version *version)if (!(version->major =strtol (version_val, &cptr,10 ))) goto ret_error; -if (version->major <4 ) +if (strcmp (nfs_version_opttbl[i],"minorversion" ) ==0 ) { + version->v_mode =V_SPECIFIC ; + version->minor = version->major; + version->major =4 ; + }else if (version->major <4 ) version->v_mode =V_SPECIFIC ;if (*cptr =='.' ) {