Commit ff88825f authored by Kinglong Mee's avatar Kinglong Mee Committed by J. Bruce Fields

NFSD: fix compile warning without CONFIG_NFSD_V3

Without CONFIG_NFSD_V3, compile will get warning as,

fs/nfsd/nfssvc.c: In function 'nfsd_svc':
>> fs/nfsd/nfssvc.c:246:60: warning: array subscript is above array bounds [-Warray-bounds]
        return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL);
                                                               ^
Reported-by: default avatarkbuild test robot <fengguang.wu@intel.com>
Signed-off-by: default avatarKinglong Mee <kinglongmee@gmail.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 8ef66714
...@@ -243,7 +243,11 @@ static void nfsd_shutdown_generic(void) ...@@ -243,7 +243,11 @@ static void nfsd_shutdown_generic(void)
static bool nfsd_needs_lockd(void) static bool nfsd_needs_lockd(void)
{ {
#if defined(CONFIG_NFSD_V3)
return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL); return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL);
#else
return (nfsd_versions[2] != NULL);
#endif
} }
static int nfsd_startup_net(int nrservs, struct net *net) static int nfsd_startup_net(int nrservs, struct net *net)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment