nfsd: Don't keep looking up unhashed files in the nfsd file cache
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 19 Feb 2021 02:02:07 +0000 (21:02 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Mar 2021 08:04:08 +0000 (09:04 +0100)
commit5ea0aa29ad4b8bc96b8cfcfb367f04b50b9cf92f
tree4cdfc799a74b2fe37919ac46b96500f378f763db
parent628f39a57a461379643c2ebc4837e31da63abfd2
nfsd: Don't keep looking up unhashed files in the nfsd file cache

commit d30881f573e565ebb5dbb50b31ed6106b5c81328 upstream.

If a file is unhashed, then we're going to reject it anyway and retry,
so make sure we skip it when we're doing the RCU lockless lookup.
This avoids a number of unnecessary nfserr_jukebox returns from
nfsd_file_acquire()

Fixes: 65294c1f2c5e ("nfsd: add a new struct file caching facility to nfsd")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/filecache.c