deepin-kernel/fs/nfsd
Chuck Lever 7a1388d443 NFSD: Force all NFSv4.2 COPY requests to be synchronous
commit 8d915bbf39 upstream.

We've discovered that delivering a CB_OFFLOAD operation can be
unreliable in some pretty unremarkable situations. Examples
include:

 - The server dropped the connection because it lost a forechannel
   NFSv4 request and wishes to force the client to retransmit
 - The GSS sequence number window under-flowed
 - A network partition occurred

When that happens, all pending callback operations, including
CB_OFFLOAD, are lost. NFSD does not retransmit them.

Moreover, the Linux NFS client does not yet support sending an
OFFLOAD_STATUS operation to probe whether an asynchronous COPY
operation has finished. Thus, on Linux NFS clients, when a
CB_OFFLOAD is lost, asynchronous COPY can hang until manually
interrupted.

I've tried a couple of remedies, but so far the side-effects are
worse than the disease and they have had to be reverted. So
temporarily force COPY operations to be synchronous so that the use
of CB_OFFLOAD is avoided entirely. This is a fix that can easily be
backported to LTS kernels. I am working on client patches that
introduce an implementation of OFFLOAD_STATUS.

Note that NFSD arbitrarily limits the size of a copy_file_range
to 4MB to avoid indefinitely blocking an nfsd thread. A short
COPY result is returned in that case, and the client can present
a fresh COPY request for the remainder.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
[ Backport from v6.10-rc1 ]
Signed-off-by: Zhao Qiang <zhao.qiang11@zte.com.cn>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
2025-07-16 19:12:35 +08:00
..
Kconfig nfs: add missing selections of CONFIG_CRC32 2025-05-09 22:54:46 +08:00
Makefile nfsd: allow disabling NFSv2 at compile time 2022-11-28 12:54:45 -05:00
acl.h NFSD: add posix ACLs to struct nfsd_attrs 2022-08-04 10:28:03 -04:00
auth.c HAOC: Add support for x86 CRED Protection (CREDP). 2025-05-12 15:02:47 +08:00
auth.h
blocklayout.c nfsd: call op_release, even when op_func returns an error 2023-03-31 17:29:49 -04:00
blocklayoutxdr.c NFSD: da_addr_body field missing in some GETDEVICEINFO replies 2023-08-29 17:45:22 -04:00
blocklayoutxdr.h
cache.h nfsd: make all of the nfsd stats per-network namespace 2024-12-10 20:40:33 +08:00
current_stateid.h
export.c nfsd: Revert "nfsd: release svc_expkey/svc_export with rcu_work" 2025-01-03 15:27:49 +08:00
export.h nfsd: Revert "nfsd: release svc_expkey/svc_export with rcu_work" 2025-01-03 15:27:49 +08:00
filecache.c nfsd: add list_head nf_gc to struct nfsd_file 2025-01-24 10:13:49 +08:00
filecache.h nfsd: add list_head nf_gc to struct nfsd_file 2025-01-24 10:13:49 +08:00
flexfilelayout.c nfsd: move nfserrno() to vfs.c 2022-11-28 12:54:44 -05:00
flexfilelayoutxdr.c NFSD: da_addr_body field missing in some GETDEVICEINFO replies 2023-08-29 17:45:22 -04:00
flexfilelayoutxdr.h
idmap.h
lockd.c
netns.h NFSD: Limit the number of concurrent async COPY operations 2024-12-10 20:43:57 +08:00
nfs2acl.c nfsd: clear acl_access/acl_default after releasing them 2025-02-28 16:45:51 +08:00
nfs3acl.c nfsd: clear acl_access/acl_default after releasing them 2025-02-28 16:45:51 +08:00
nfs3proc.c nfsd: handle failure to collect pre/post-op attrs more sanely 2023-08-29 17:45:22 -04:00
nfs3xdr.c NFSD: Ensure that xdr_write_pages updates rq_next_page 2023-06-05 09:01:44 -04:00
nfs4acl.c nfsd: inherit required unset default acls from effective set 2023-08-29 17:45:22 -04:00
nfs4callback.c HAOC: Add support for x86 CRED Protection (CREDP). 2025-05-12 15:02:47 +08:00
nfs4idmap.c nfsd: call cache_put if xdr_reserve_space returns NULL 2024-12-10 20:42:00 +08:00
nfs4layouts.c nfsd: fix race to check ls_layouts 2023-02-20 09:20:56 -05:00
nfs4proc.c NFSD: Force all NFSv4.2 COPY requests to be synchronous 2025-07-16 19:12:35 +08:00
nfs4recover.c HAOC: Add support for x86 CRED Protection (CREDP). 2025-05-12 15:02:47 +08:00
nfs4state.c nfsd: decrease sc_count directly if fail to queue dl_recall 2025-05-09 22:54:46 +08:00
nfs4xdr.c NFSD: Fix NFSv4's PUTPUBFH operation 2024-12-10 20:42:31 +08:00
nfscache.c nfsd: make all of the nfsd stats per-network namespace 2024-12-10 20:40:33 +08:00
nfsctl.c nfsd: make svc_stat per-network namespace instead of global 2024-12-10 20:40:33 +08:00
nfsd.h nfsd: remove nfsd_stats, make th_cnt a global counter 2024-12-10 20:40:33 +08:00
nfsfh.c HAOC: Add support for x86 CRED Protection (CREDP). 2025-05-12 15:02:47 +08:00
nfsfh.h nfs: add missing selections of CONFIG_CRC32 2025-05-09 22:54:46 +08:00
nfsproc.c NFSD: Hoist rq_vec preparation into nfsd_read() 2023-06-11 16:37:45 -04:00
nfssvc.c nfsd: Initialize ssc before laundromat_work to prevent NULL dereference 2025-07-03 11:31:51 +08:00
nfsxdr.c NFSD: Ensure that xdr_write_pages updates rq_next_page 2023-06-05 09:01:44 -04:00
pnfs.h
state.h NFSD: handle GETATTR conflict with write delegation 2023-08-29 17:45:22 -04:00
stats.c nfsd: make svc_stat per-network namespace instead of global 2024-12-10 20:40:33 +08:00
stats.h nfsd: make svc_stat per-network namespace instead of global 2024-12-10 20:40:33 +08:00
trace.c
trace.h NFSD: Fix nfsd_clid_class use of __string_len() macro 2024-04-03 15:28:35 +02:00
vfs.c nfsd: map the EBADMSG to nfserr_io to avoid warning 2024-12-10 20:42:31 +08:00
vfs.h nfsd: Handle EOPENSTALE correctly in the filecache 2023-11-20 11:58:52 +01:00
xdr.h
xdr3.h
xdr4.h NFSD: Limit the number of concurrent async COPY operations 2024-12-10 20:43:57 +08:00
xdr4cb.h NFSD: add support for sending CB_RECALL_ANY 2022-12-10 11:01:12 -05:00