aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/fs_context.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2020-01-17 15:55:09 +0000
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2020-01-24 16:51:13 -0500
commit3a21409a0b4bce3171001b168ca42285004c873c (patch)
tree74488f68b2f61e645554927aff5fac22bd95a51b /fs/nfs/fs_context.c
parentNFS: allow deprecation of NFS UDP protocol (diff)
downloadlinux-dev-3a21409a0b4bce3171001b168ca42285004c873c.tar.xz
linux-dev-3a21409a0b4bce3171001b168ca42285004c873c.zip
nfs: Return EINVAL rather than ERANGE for mount parse errors
Return EINVAL rather than ERANGE for mount parse errors as the userspace mount command doesn't necessarily understand what to do with anything other than EINVAL. The old code returned -ERANGE as an intermediate error that then get converted to -EINVAL, whereas the new code returns -ERANGE. This was induced by passing minorversion=1 to a v4 mount where CONFIG_NFS_V4_1 was disabled in the kernel build. Fixes: 68f65ef40e1e ("NFS: Convert mount option parsing to use functionality from fs_parser.h") Reported-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/fs_context.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c
index dfd95847f005..2c6dc1b6cc92 100644
--- a/fs/nfs/fs_context.c
+++ b/fs/nfs/fs_context.c
@@ -779,8 +779,7 @@ out_invalid_value:
out_invalid_address:
return nfs_invalf(fc, "NFS: Bad IP address specified");
out_of_bounds:
- nfs_invalf(fc, "NFS: Value for '%s' out of range", param->key);
- return -ERANGE;
+ return nfs_invalf(fc, "NFS: Value for '%s' out of range", param->key);
}
/*