NFSD: fix nfsd_minorversion(.., NFSD_AVAIL)
authorNeilBrown <neilb@suse.com>
Fri, 10 Mar 2017 00:36:39 +0000 (11:36 +1100)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 10 Mar 2017 22:04:50 +0000 (17:04 -0500)
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 <neilb@suse.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfssvc.c

index 786a4a2cb2d7a96cbde629c17b6ac58ab82bc84e..892137b1e330308446eb0397433f8cd573821d28 100644 (file)
@@ -167,7 +167,8 @@ nfsd_adjust_nfsd_versions4(void)
 
 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: