]> git.baikalelectronics.ru Git - kernel.git/commit
nfs: fix port value parsing
authorIan Kent <raven@themaw.net>
Sat, 2 Jul 2022 00:23:47 +0000 (08:23 +0800)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 12 Jul 2022 14:53:10 +0000 (10:53 -0400)
commit167e8530140c82a9d09b56fa95e9b4c58652a461
treeb732e2ab86f31a7d0584b294692a85a993dd4b33
parent755a1a0eb1f31a31a69e4807b1f8d19caab20a71
nfs: fix port value parsing

The valid values of nfs options port and mountport are 0 to USHRT_MAX.

The fs parser will return a fail for port values that are negative
and the sloppy option handling then returns success.

But the sloppy option handling is meant to return success for invalid
options not valid options with invalid values.

Restricting the sloppy option override to handle failure returns for
invalid options only is sufficient to resolve this problem.

Changes:

v2: utilize the return value from fs_parse() to resolve this problem
    instead of changing the parameter definitions.

Suggested-by: Trond Myklebust <trondmy@hammerspace.com>
Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/fs_context.c