This is a note to let you know that I've just added the patch titled nfsd: Don't keep looking up unhashed files in the nfsd file cache to the 5.4-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: nfsd-don-t-keep-looking-up-unhashed-files-in-the-nfsd-file-cache.patch and it can be found in the queue-5.4 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From d30881f573e565ebb5dbb50b31ed6106b5c81328 Mon Sep 17 00:00:00 2001 From: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx> Date: Thu, 18 Feb 2021 21:02:07 -0500 Subject: nfsd: Don't keep looking up unhashed files in the nfsd file cache From: Trond Myklebust <trond.myklebust@xxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/nfsd/filecache.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -751,6 +751,8 @@ nfsd_file_find_locked(struct inode *inod continue; if (!nfsd_match_cred(nf->nf_cred, current_cred())) continue; + if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags)) + continue; if (nfsd_file_get(nf) != NULL) return nf; } Patches currently in stable-queue which might be from trond.myklebust@xxxxxxxxxxxxxxx are queue-5.4/nfsd-don-t-keep-looking-up-unhashed-files-in-the-nfsd-file-cache.patch