Skip to content

Commit

Permalink
NFSD: fix nfsd_minorversion(.., NFSD_AVAIL)
Browse files Browse the repository at this point in the history
[ Upstream commit 928c6fb ]

Current code will return 1 if the version is supported,
and -1 if it isn't.
This is confusing and inconsistent with the one place where this
is used.
So change to return 1 if it is supported, and zero if not.
i.e. an error is never returned.

Signed-off-by: NeilBrown <[email protected]>
Signed-off-by: J. Bruce Fields <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
NeilBrown authored and gregkh committed Dec 20, 2017
1 parent 063c753 commit 0154269
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/nfsd/nfssvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ int nfsd_vers(int vers, enum vers_op change)

int nfsd_minorversion(u32 minorversion, enum vers_op change)
{
if (minorversion > NFSD_SUPPORTED_MINOR_VERSION)
if (minorversion > NFSD_SUPPORTED_MINOR_VERSION &&
change != NFSD_AVAIL)
return -1;
switch(change) {
case NFSD_SET:
Expand Down

0 comments on commit 0154269

Please sign in to comment.