aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2014-01-05 22:28:41 -0500
committerJ. Bruce Fields <bfields@redhat.com>2014-01-06 12:23:31 -0500
commitff88825fbb9f5a503164bb5ad4a8c65dabfa13e0 (patch)
tree11a964af266c0357a917f95e3710bb74656033a0 /fs/nfsd
parent8ef667140c52e9b88934664954217f28559c75d6 (diff)
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: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfssvc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfsd/nfssvc.c b/fs/nfsd/nfssvc.c
index 55b5b57b5715..9a4a5f9e7468 100644
--- a/fs/nfsd/nfssvc.c
+++ b/fs/nfsd/nfssvc.c
@@ -243,7 +243,11 @@ static void nfsd_shutdown_generic(void)
243 243
244static bool nfsd_needs_lockd(void) 244static bool nfsd_needs_lockd(void)
245{ 245{
246#if defined(CONFIG_NFSD_V3)
246 return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL); 247 return (nfsd_versions[2] != NULL) || (nfsd_versions[3] != NULL);
248#else
249 return (nfsd_versions[2] != NULL);
250#endif
247} 251}
248 252
249static int nfsd_startup_net(int nrservs, struct net *net) 253static int nfsd_startup_net(int nrservs, struct net *net)