Skip to content

Commit d30881f

Browse files
Trond Myklebustchucklever
authored andcommitted
nfsd: Don't keep looking up unhashed files in the nfsd file cache
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>
1 parent a38fd87 commit d30881f

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
@@ -898,6 +898,8 @@ nfsd_file_find_locked(struct inode *inode, unsigned int may_flags,
898898
continue;
899899
if (!nfsd_match_cred(nf->nf_cred, current_cred()))
900900
continue;
901+
if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags))
902+
continue;
901903
if (nfsd_file_get(nf) != NULL)
902904
return nf;
903905
}

0 commit comments

Comments
 (0)