NFSD: don't report compiled-out versions as present
authorPavel Emelyanov <xemul@openvz.org>
Fri, 14 May 2010 11:33:36 +0000 (15:33 +0400)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Fri, 14 May 2010 22:46:14 +0000 (18:46 -0400)
The /proc/fs/nfsd/versions file calls nfsd_vers() to check whether
the particular nfsd version is present/available. The problem is
that once I turn off e.g. NFSD-V4 this call returns -1 which is
true from the callers POV which is wrong.

The proposal is to report false in that case.

The bug has existed since 6658d3a7bbfd1768 "[PATCH] knfsd: remove
nfsd_versbits as intermediate storage for desired versions".

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Cc: stable@kernel.org
Acked-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfssvc.c

index 171699eb07c879893d1e874470c4f5922f570709..06b2a26edfe01736274e1d489988f73735f2913b 100644 (file)
@@ -120,7 +120,7 @@ u32 nfsd_supported_minorversion;
 int nfsd_vers(int vers, enum vers_op change)
 {
        if (vers < NFSD_MINVERS || vers >= NFSD_NRVERS)
-               return -1;
+               return 0;
        switch(change) {
        case NFSD_SET:
                nfsd_versions[vers] = nfsd_version[vers];