FAILED: patch "[PATCH] nfsd: fix nfsd_file leak on inter-server COPY setup failure" failed to apply to 5.10-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y
git checkout FETCH_HEAD
git cherry-pick -x 88a76145451d703eedd867b5989bf73d17340399
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026090342-mute-statistic-4761@gregkh' --subject-prefix 'PATCH 5.10.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 88a76145451d703eedd867b5989bf73d17340399 Mon Sep 17 00:00:00 2001
From: Jeff Layton <[email protected]>
Date: Sun, 31 May 2026 08:07:00 -0400
Subject: [PATCH] nfsd: fix nfsd_file leak on inter-server COPY setup failure
When nfsd4_setup_inter_ssc() fails, nfsd4_copy() returns nfserr_offload_denied directly, bypassing the out: label where release_copy_files() would drop the nf_dst reference taken by nfs4_preprocess_stateid_op(). Each failed inter-server COPY leaks one nfsd_file, pinning file/inode/dentry/vfsmount.
Fix by setting status and jumping to out: instead of returning directly.
fs/nfsd/nfs4proc.c +4 -6
@@ -2159,16 +2159,14 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, } status =nfsd4_setup_inter_ssc (rqstp, cstate, copy);if (status) { -trace_nfsd_copy_done (copy, status); -return nfserr_offload_denied; + status = nfserr_offload_denied; + goto out; } }else {trace_nfsd_copy_intra (copy); status =nfsd4_setup_intra_ssc (rqstp, cstate, copy); -if (status) { -trace_nfsd_copy_done (copy, status); -return status; - } +if (status) + goto out; } memcpy(©->fh, &cstate->current_fh.fh_handle,
Sasha Levin
maintainerPATCH 1/1 nfsd: fix nfsd_file leak on inter-server COPY setup failure
From: Jeff Layton <[email protected]>
[ Upstream commit 88a76145451d703eedd867b5989bf73d17340399 ]
When nfsd4_setup_inter_ssc() fails, nfsd4_copy() returns nfserr_offload_denied directly, bypassing the out: label where release_copy_files() would drop the nf_dst reference taken by nfs4_preprocess_stateid_op(). Each failed inter-server COPY leaks one nfsd_file, pinning file/inode/dentry/vfsmount.
Fix by setting status and jumping to out: instead of returning directly.
--- fs/nfsd/nfs4proc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
fs/nfsd/nfs4proc.c +5 -3
@@ -1776,12 +1776,14 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, goto out; } status =nfsd4_setup_inter_ssc (rqstp, cstate, copy); -if (status) -return nfserr_offload_denied; +if (status) { + status = nfserr_offload_denied; + goto out; + } }else { status =nfsd4_setup_intra_ssc (rqstp, cstate, copy);if (status) -return status; + goto out; } memcpy(©->fh, &cstate->current_fh.fh_handle,
Signature · 1 line
2.53.0