Commit d30881f5 authored by Trond Myklebust's avatar Trond Myklebust Committed by Chuck Lever
Browse files

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: 65294c1f ("nfsd: add a new struct file caching facility to nfsd")
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent a38fd874
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -898,6 +898,8 @@ nfsd_file_find_locked(struct inode *inode, unsigned int may_flags,
			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;
	}