From: Jeff Layton <jlayton@kernel.org>
To: Lubos Rendek <l.rendek@proxmox.com>, stable@vger.kernel.org
Cc: "Sasha Levin" <sashal@kernel.org>, "Chuck Lever" <cel@kernel.org>,
linux-nfs@vger.kernel.org, regressions@lists.linux.dev,
linux-kernel@vger.kernel.org,
"Fabian Grünbichler" <f.gruenbichler@proxmox.com>
Subject: Re: [PATCH 6.18.y] nfsd: fix all-zero stateid in CB_OFFLOAD for async COPY
Date: Thu, 15 Oct 2026 13:15:07 -0400 [thread overview]
Message-ID: <b0e11c64a2cacb1582e44020de115895fcc6ed0e.camel@kernel.org> (raw)
In-Reply-To: <20261015005725.550511-1-l.rendek@proxmox.com>
On Thu, 2026-10-15 at 11:57 +1100, Lubos Rendek wrote:
> [ There is no upstream commit: this fixes the 6.18.y backport of
> d0beaee498e1. Mainline fixed the problem as part of the async COPY
> rework in commit f307b4f7ed17 ("nfsd: split nfsd4_copy into transient
> and durable async copy objects"), which is too risky to backport. ]
>
> Since commit 9b4e5e9ba5ae ("nfsd: fix stale s2s_cp_stateids IDR entry
> for async COPY"), nfsd4_copy() calls dup_copy_fields() before the copy
> stateid is created and then writes the new stateid only into the COPY
> result. The async copy's own cp_res.cb_stateid stays zero, so
> nfsd4_send_cb_offload() sends CB_OFFLOAD with an all-zero stateid. The
> client cannot match it to its pending COPY and waits forever in
> nfs42_proc_copy().
>
> Also copy the new stateid into async_copy->cp_res.cb_stateid. Calling
> dup_copy_fields() after nfs4_init_copy_state() instead is not an
> option, because dup_copy_fields() also copies cp_stateid and would
> overwrite the stateid that the backport moved to the async copy.
>
> Tested on 6.18.56 with an NFSv4.2 server-side COPY between two
> exports: with this change the copy completes and CB_OFFLOAD carries
> the same stateid as the COPY reply. Without it, cp(1) hangs on
> 6.18.55; the affected code in nfsd4_copy() is the same in 6.18.56.
>
> Fixes: 9b4e5e9ba5ae ("nfsd: fix stale s2s_cp_stateids IDR entry for async COPY")
> Closes: https://lore.kernel.org/stable/7cc824c4-632d-49df-ae5e-cfcbb5bf76ad@proxmox.com/
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Lubos Rendek <l.rendek@proxmox.com>
> ---
> fs/nfsd/nfs4proc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index bc14c3939..aeab09dde 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -2084,6 +2084,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
> goto out_dec_async_copy_err;
> memcpy(&result->cb_stateid, &async_copy->cp_stateid.cs_stid,
> sizeof(result->cb_stateid));
> + memcpy(&async_copy->cp_res.cb_stateid, &async_copy->cp_stateid.cs_stid,
> + sizeof(async_copy->cp_res.cb_stateid));
> if ((READ_ONCE(copy->nf_dst->nf_file->f_mode) &
> FMODE_NOCMTIME) != 0)
> async_copy->attr_update = true;
Reviewed-by: Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2026-10-15 17:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-10 19:30 [REGRESSION] 7.2.4: nfsd sends CB_OFFLOAD with all-zero stateid, async NFSv4.2 COPY never completes Lubos Rendek
2026-10-11 7:19 ` Greg KH
2026-10-11 12:07 ` Jeff Layton
2026-10-11 20:33 ` Lubos Rendek
2026-10-11 16:48 ` Sasha Levin
2026-10-12 9:36 ` Fabian Grünbichler
2026-10-12 14:59 ` Sasha Levin
2026-10-13 10:15 ` Jeff Layton
2026-10-13 19:45 ` Lubos Rendek
2026-10-15 0:53 ` [PATCH 7.2.y] nfsd: fix all-zero stateid in CB_OFFLOAD for async COPY Lubos Rendek
2026-10-15 17:14 ` Jeff Layton
2026-10-15 19:35 ` Sasha Levin
2026-10-15 0:57 ` [PATCH 6.18.y] " Lubos Rendek
2026-10-15 17:15 ` Jeff Layton [this message]
2026-10-15 19:35 ` Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0e11c64a2cacb1582e44020de115895fcc6ed0e.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=cel@kernel.org \
--cc=f.gruenbichler@proxmox.com \
--cc=l.rendek@proxmox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=regressions@lists.linux.dev \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®