5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jeff Layton [ 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. Fixes: ce0887ac96d3 ("NFSD add nfs4 inter ssc to nfsd4_copy") Cc: stable@vger.kernel.org Assisted-by: kres:claude-opus-4-7 Signed-off-by: Jeff Layton Link: https://patch.msgid.link/20260531-nfsd-testing-v1-3-7bfa481b0540@kernel.org Signed-off-by: Chuck Lever [ adjusted cleanup paths to omit unavailable trace_nfsd_copy_*() calls ] Signed-off-by: Sasha Levin --- fs/nfsd/nfs4proc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 8db5b820ac558..ecf10e6fdab36 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1778,12 +1778,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, -- 2.53.0