Skip to content

Commit 0ce35ee

Browse files
Don BradyDelphix Engineering
Don Brady
authored and
Delphix Engineering
committed
DLPX-75524 avoid unnecessary nfserr_jukebox returns from nfsd_file_acquire (#9)
Upstream fix from kernel 5.12 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")
1 parent 8536f10 commit 0ce35ee

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

fs/nfsd/filecache.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,9 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
974974
if (!new) {
975975
trace_nfsd_file_acquire(rqstp, hashval, inode, may_flags,
976976
NULL, nfserr_jukebox);
977+
pr_warn_ratelimited("nfsd: nfsd_file_acquire alloc failed XID, "
978+
"%08x, nfserr_jukebox\n",
979+
be32_to_cpu(rqstp->rq_xid));
977980
return nfserr_jukebox;
978981
}
979982

@@ -991,6 +994,10 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
991994
if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags)) {
992995
if (!retry) {
993996
status = nfserr_jukebox;
997+
pr_warn_ratelimited("nfsd: nfsd_file_acquire "
998+
"construction failed, XID %08x, "
999+
"nfserr_jukebox\n",
1000+
be32_to_cpu(rqstp->rq_xid));
9941001
goto out;
9951002
}
9961003
retry = false;
@@ -1041,11 +1048,15 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
10411048
nfsd_file_gc();
10421049

10431050
nf->nf_mark = nfsd_file_mark_find_or_create(nf);
1044-
if (nf->nf_mark)
1051+
if (nf->nf_mark) {
10451052
status = nfsd_open_verified(rqstp, fhp, S_IFREG,
10461053
may_flags, &nf->nf_file);
1047-
else
1054+
} else {
1055+
pr_warn_ratelimited("nfsd: nfsd_file_acquire no file mark, XID "
1056+
"%08x, nfserr_jukebox\n",
1057+
be32_to_cpu(rqstp->rq_xid));
10481058
status = nfserr_jukebox;
1059+
}
10491060
/*
10501061
* If construction failed, or we raced with a call to unlink()
10511062
* then unhash.

0 commit comments

Comments
 (0)