Skip to content

Commit 10e5074

Browse files
Trond Myklebustsmb49
authored andcommitted
nfsd: Don't keep looking up unhashed files in the nfsd file cache
BugLink: https://bugs.launchpad.net/bugs/1923214 commit d30881f 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: 65294c1 ("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> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 862ec0e commit 10e5074

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/nfsd/filecache.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,8 @@ nfsd_file_find_locked(struct inode *inode, unsigned int may_flags,
751751
continue;
752752
if (!nfsd_match_cred(nf->nf_cred, current_cred()))
753753
continue;
754+
if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags))
755+
continue;
754756
if (nfsd_file_get(nf) != NULL)
755757
return nf;
756758
}

0 commit comments

Comments
 (0)