diff options
| author | Chuck Lever <chuck.lever@oracle.com> | 2024-10-31 09:40:08 -0400 |
|---|---|---|
| committer | Chuck Lever <chuck.lever@oracle.com> | 2024-11-18 20:23:11 -0500 |
| commit | aa0ebd21df9c90a69f8bf00e3fa49d476be8e290 (patch) | |
| tree | 0540028b33ab47005fa8b525a4b9f9cc3f91f5e9 /fs/nfsd/state.h | |
| parent | ac0514f4d198b5d1d5ba367b122cdf5a68e711d4 (diff) | |
NFSD: Add nfsd4_copy time-to-live
Keep async copy state alive for a few lease cycles after the copy
completes so that OFFLOAD_STATUS returns something meaningful.
This means that NFSD's client shutdown processing needs to purge
any of this state that happens to be waiting to die.
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Diffstat (limited to 'fs/nfsd/state.h')
| -rw-r--r-- | fs/nfsd/state.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index dcbebd53e5f4..8092894e8f3c 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h @@ -137,6 +137,21 @@ struct nfs4_cpntf_state { time64_t cpntf_time; /* last time stateid used */ }; +/* + * RFC 7862 Section 4.8 states: + * + * | A copy offload stateid will be valid until either (A) the client + * | or server restarts or (B) the client returns the resource by + * | issuing an OFFLOAD_CANCEL operation or the client replies to a + * | CB_OFFLOAD operation. + * + * Because a client might not reply to a CB_OFFLOAD, or a reply + * might get lost due to connection loss, NFSD purges async copy + * state after a short period to prevent it from accumulating + * over time. + */ +#define NFSD_COPY_INITIAL_TTL 10 + struct nfs4_cb_fattr { struct nfsd4_callback ncf_getattr; u32 ncf_cb_status; |
