Skip to content

Commit 7a1388d

Browse files
chuckleveropsiff
authored andcommitted
NFSD: Force all NFSv4.2 COPY requests to be synchronous
commit 8d915bb 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>
1 parent 9d3c7c0 commit 7a1388d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

fs/nfsd/nfs4proc.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,6 +1794,13 @@ nfsd4_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
17941794
struct nfsd42_write_res *result;
17951795
__be32 status;
17961796

1797+
/*
1798+
* Currently, async COPY is not reliable. Force all COPY
1799+
* requests to be synchronous to avoid client application
1800+
* hangs waiting for COPY completion.
1801+
*/
1802+
nfsd4_copy_set_sync(copy, true);
1803+
17971804
result = &copy->cp_res;
17981805
nfsd_copy_write_verifier((__be32 *)&result->wr_verifier.data, nn);
17991806

0 commit comments

Comments
 (0)