Re: [PATCH] nfsd: fix inverted cp_ttl check in async copy reaper

From: Chuck Lever

Date: Thu May 21 2026 - 13:09:40 EST


From: Chuck Lever <chuck.lever@xxxxxxxxxx>

On Thu, 21 May 2026 09:25:40 -0400, Jeff Layton wrote:
> nfsd4_async_copy_reaper() is supposed to keep completed async copy
> state around for NFSD_COPY_INITIAL_TTL (10) laundromat ticks so
> that OFFLOAD_STATUS can report the result, then reap the state once
> the countdown expires.
>
> The TTL predicate is inverted: `if (--copy->cp_ttl)` is true while
> ticks remain and false when the counter reaches zero. This causes
> the copy to be reaped on the very first tick (cp_ttl goes from 10
> to 9, which is non-zero) instead of after all 10 ticks elapse.
> Once reaped, OFFLOAD_STATUS returns NFS4ERR_BAD_STATEID because
> the copy state has already been freed.
>
> [...]

Applied to nfsd-testing, thanks!

[1/1] nfsd: fix inverted cp_ttl check in async copy reaper
commit: 14ba3b4b7cb4d05a070c77226d10dfc332898421

--
Chuck Lever <chuck.lever@xxxxxxxxxx>