Skip to content

Commit 1f49828

Browse files
Don BradyDelphix Engineering
Don Brady
authored and
Delphix Engineering
committed
DLPX-75524 avoid unnecessary nfserr_jukebox returns from nfsd_file_acquire (#8)
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 7eb26e2 commit 1f49828

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
@@ -965,6 +965,9 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
965965
if (!new) {
966966
trace_nfsd_file_acquire(rqstp, hashval, inode, may_flags,
967967
NULL, nfserr_jukebox);
968+
pr_warn_ratelimited("nfsd: nfsd_file_acquire alloc failed XID, "
969+
"%08x, nfserr_jukebox\n",
970+
be32_to_cpu(rqstp->rq_xid));
968971
return nfserr_jukebox;
969972
}
970973

@@ -982,6 +985,10 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
982985
if (!test_bit(NFSD_FILE_HASHED, &nf->nf_flags)) {
983986
if (!retry) {
984987
status = nfserr_jukebox;
988+
pr_warn_ratelimited("nfsd: nfsd_file_acquire "
989+
"construction failed, XID %08x, "
990+
"nfserr_jukebox\n",
991+
be32_to_cpu(rqstp->rq_xid));
985992
goto out;
986993
}
987994
retry = false;
@@ -1032,11 +1039,15 @@ nfsd_file_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
10321039
nfsd_file_gc();
10331040

10341041
nf->nf_mark = nfsd_file_mark_find_or_create(nf);
1035-
if (nf->nf_mark)
1042+
if (nf->nf_mark) {
10361043
status = nfsd_open_verified(rqstp, fhp, S_IFREG,
10371044
may_flags, &nf->nf_file);
1038-
else
1045+
} else {
1046+
pr_warn_ratelimited("nfsd: nfsd_file_acquire no file mark, XID "
1047+
"%08x, nfserr_jukebox\n",
1048+
be32_to_cpu(rqstp->rq_xid));
10391049
status = nfserr_jukebox;
1050+
}
10401051
/*
10411052
* If construction failed, or we raced with a call to unlink()
10421053
* then unhash.

0 commit comments

Comments
 (0)