* [PATCH] mount.nfs: Recognize v4.x mount options
@ 2013-11-13 15:14 Weston Andros Adamson
2013-11-13 15:16 ` Chuck Lever
2013-11-20 21:22 ` Steve Dickson
0 siblings, 2 replies; 3+ messages in thread
From: Weston Andros Adamson @ 2013-11-13 15:14 UTC (permalink / raw)
To: steved; +Cc: linux-nfs, Weston Andros Adamson
The kernel understands text options of the form "v4.x" (ie "v4.1"), but
mount.nfs does not and this leads to weird errors when the requested
mount fails: a line in dmesg about version 3 not supporting minorversions
and mount.nfs returning EINVAL no matter what the real error was.
This happens because mount.nfs thinks no version was specified so it starts
probing other versions which conflicts with the v4.X option once it gets
parsed by the kernel.
$ sudo mount -v -o v4.1 zero:/invalid_export /mnt
mount.nfs: timeout set for Wed Nov 13 10:09:48 2013
mount.nfs: trying text-based options 'v4.1,vers=4,addr=192.168.100.10,clientaddr=192.168.100.11'
mount.nfs: mount(2): No such file or directory
mount.nfs: trying text-based options 'v4.1,addr=192.168.100.10'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.100.10 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.100.10 prog 100005 vers 3 prot UDP port 20048
mount.nfs: mount(2): Invalid argument
mount.nfs: an incorrect mount option was specified
And you get this in dmesg:
NFS: mount option vers=3 does not support minorversion=1
but if you use another form of the same options, this doesn't happen:
$ sudo mount -v -o vers=4,minorversion=1 zero:/invalid_export /mnt
mount.nfs: timeout set for Wed Nov 13 10:10:28 2013
mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.100.10,clientaddr=192.168.100.11'
mount.nfs: mount(2): No such file or directory
mount.nfs: mounting zero:/invalid_export failed, reason given by server: No such file or directory
Signed-off-by: Weston Andros Adamson <dros@netapp.com>
---
utils/mount/network.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/utils/mount/network.c b/utils/mount/network.c
index e8e55a5..2853d00 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -92,6 +92,9 @@ static const char *nfs_version_opttbl[] = {
"v4",
"vers",
"nfsvers",
+ "v4.0",
+ "v4.1",
+ "v4.2",
NULL,
};
@@ -1269,6 +1272,11 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
progname);
return 0;
}
+ case 5: /* v4.0 */
+ case 6: /* v4.1 */
+ case 7: /* v4.2 */
+ *version = 4;
+ return 1;
}
/*
--
1.8.3.1 (Apple Git-46)
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] mount.nfs: Recognize v4.x mount options
2013-11-13 15:14 [PATCH] mount.nfs: Recognize v4.x mount options Weston Andros Adamson
@ 2013-11-13 15:16 ` Chuck Lever
2013-11-20 21:22 ` Steve Dickson
1 sibling, 0 replies; 3+ messages in thread
From: Chuck Lever @ 2013-11-13 15:16 UTC (permalink / raw)
To: Weston Andros Adamson; +Cc: steved, linux-nfs
On Nov 13, 2013, at 10:14 AM, Weston Andros Adamson <dros@netapp.com> wrote:
> The kernel understands text options of the form "v4.x" (ie "v4.1"), but
> mount.nfs does not and this leads to weird errors when the requested
> mount fails: a line in dmesg about version 3 not supporting minorversions
> and mount.nfs returning EINVAL no matter what the real error was.
>
> This happens because mount.nfs thinks no version was specified so it starts
> probing other versions which conflicts with the v4.X option once it gets
> parsed by the kernel.
>
> $ sudo mount -v -o v4.1 zero:/invalid_export /mnt
> mount.nfs: timeout set for Wed Nov 13 10:09:48 2013
> mount.nfs: trying text-based options 'v4.1,vers=4,addr=192.168.100.10,clientaddr=192.168.100.11'
> mount.nfs: mount(2): No such file or directory
> mount.nfs: trying text-based options 'v4.1,addr=192.168.100.10'
> mount.nfs: prog 100003, trying vers=3, prot=6
> mount.nfs: trying 192.168.100.10 prog 100003 vers 3 prot TCP port 2049
> mount.nfs: prog 100005, trying vers=3, prot=17
> mount.nfs: trying 192.168.100.10 prog 100005 vers 3 prot UDP port 20048
> mount.nfs: mount(2): Invalid argument
> mount.nfs: an incorrect mount option was specified
>
> And you get this in dmesg:
>
> NFS: mount option vers=3 does not support minorversion=1
>
> but if you use another form of the same options, this doesn't happen:
>
> $ sudo mount -v -o vers=4,minorversion=1 zero:/invalid_export /mnt
> mount.nfs: timeout set for Wed Nov 13 10:10:28 2013
> mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.100.10,clientaddr=192.168.100.11'
> mount.nfs: mount(2): No such file or directory
> mount.nfs: mounting zero:/invalid_export failed, reason given by server: No such file or directory
Actually, I have been wondering how all this worked without any changes to mount.nfs. :-)
Acked-by: Chuck Lever <chuck.lever@oracle.com>
> Signed-off-by: Weston Andros Adamson <dros@netapp.com>
> ---
> utils/mount/network.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/utils/mount/network.c b/utils/mount/network.c
> index e8e55a5..2853d00 100644
> --- a/utils/mount/network.c
> +++ b/utils/mount/network.c
> @@ -92,6 +92,9 @@ static const char *nfs_version_opttbl[] = {
> "v4",
> "vers",
> "nfsvers",
> + "v4.0",
> + "v4.1",
> + "v4.2",
> NULL,
> };
>
> @@ -1269,6 +1272,11 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
> progname);
> return 0;
> }
> + case 5: /* v4.0 */
> + case 6: /* v4.1 */
> + case 7: /* v4.2 */
> + *version = 4;
> + return 1;
> }
>
> /*
> --
> 1.8.3.1 (Apple Git-46)
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] mount.nfs: Recognize v4.x mount options
2013-11-13 15:14 [PATCH] mount.nfs: Recognize v4.x mount options Weston Andros Adamson
2013-11-13 15:16 ` Chuck Lever
@ 2013-11-20 21:22 ` Steve Dickson
1 sibling, 0 replies; 3+ messages in thread
From: Steve Dickson @ 2013-11-20 21:22 UTC (permalink / raw)
To: Weston Andros Adamson; +Cc: linux-nfs
On 13/11/13 10:14, Weston Andros Adamson wrote:
> The kernel understands text options of the form "v4.x" (ie "v4.1"), but
> mount.nfs does not and this leads to weird errors when the requested
> mount fails: a line in dmesg about version 3 not supporting minorversions
> and mount.nfs returning EINVAL no matter what the real error was.
>
> This happens because mount.nfs thinks no version was specified so it starts
> probing other versions which conflicts with the v4.X option once it gets
> parsed by the kernel.
>
> $ sudo mount -v -o v4.1 zero:/invalid_export /mnt
> mount.nfs: timeout set for Wed Nov 13 10:09:48 2013
> mount.nfs: trying text-based options 'v4.1,vers=4,addr=192.168.100.10,clientaddr=192.168.100.11'
> mount.nfs: mount(2): No such file or directory
> mount.nfs: trying text-based options 'v4.1,addr=192.168.100.10'
> mount.nfs: prog 100003, trying vers=3, prot=6
> mount.nfs: trying 192.168.100.10 prog 100003 vers 3 prot TCP port 2049
> mount.nfs: prog 100005, trying vers=3, prot=17
> mount.nfs: trying 192.168.100.10 prog 100005 vers 3 prot UDP port 20048
> mount.nfs: mount(2): Invalid argument
> mount.nfs: an incorrect mount option was specified
>
> And you get this in dmesg:
>
> NFS: mount option vers=3 does not support minorversion=1
>
> but if you use another form of the same options, this doesn't happen:
>
> $ sudo mount -v -o vers=4,minorversion=1 zero:/invalid_export /mnt
> mount.nfs: timeout set for Wed Nov 13 10:10:28 2013
> mount.nfs: trying text-based options 'vers=4,minorversion=1,addr=192.168.100.10,clientaddr=192.168.100.11'
> mount.nfs: mount(2): No such file or directory
> mount.nfs: mounting zero:/invalid_export failed, reason given by server: No such file or directory
>
> Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Committed (tag: nfs-utils-1-2-10-rc1)
steved.
> ---
> utils/mount/network.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/utils/mount/network.c b/utils/mount/network.c
> index e8e55a5..2853d00 100644
> --- a/utils/mount/network.c
> +++ b/utils/mount/network.c
> @@ -92,6 +92,9 @@ static const char *nfs_version_opttbl[] = {
> "v4",
> "vers",
> "nfsvers",
> + "v4.0",
> + "v4.1",
> + "v4.2",
> NULL,
> };
>
> @@ -1269,6 +1272,11 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
> progname);
> return 0;
> }
> + case 5: /* v4.0 */
> + case 6: /* v4.1 */
> + case 7: /* v4.2 */
> + *version = 4;
> + return 1;
> }
>
> /*
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-11-20 21:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-13 15:14 [PATCH] mount.nfs: Recognize v4.x mount options Weston Andros Adamson
2013-11-13 15:16 ` Chuck Lever
2013-11-20 21:22 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).