]> git.baikalelectronics.ru Git - kernel.git/commit
nfs: Return EINVAL rather than ERANGE for mount parse errors
authorDavid Howells <dhowells@redhat.com>
Fri, 17 Jan 2020 15:55:09 +0000 (15:55 +0000)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 24 Jan 2020 21:51:13 +0000 (16:51 -0500)
commit34f48d96cdb530c0468de81b09a8f2ea64d51276
tree74488f68b2f61e645554927aff5fac22bd95a51b
parent5f894806808dec96b43de1c256e364b4d3c54fff
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>
fs/nfs/fs_context.c