+8
−15
Loading
stable inclusion from stable-v6.6.63 commit 20a10c78ac3a8b608dca7c42bd6a982b192f55dd category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBI1RP Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=20a10c78ac3a8b608dca7c42bd6a982b192f55dd -------------------------------- [ Upstream commit 9ed666eba4e0a2bb8ffaa3739d830b64d4f2aaad ] Currently, when NFSD handles an asynchronous COPY, it returns a zero write verifier, relying on the subsequent CB_OFFLOAD callback to pass the write verifier and a stable_how4 value to the client. However, if the CB_OFFLOAD never arrives at the client (for example, if a network partition occurs just as the server sends the CB_OFFLOAD operation), the client will never receive this verifier. Thus, if the client sends a follow-up COMMIT, there is no way for the client to assess the COMMIT result. The usual recovery for a missing CB_OFFLOAD is for the client to send an OFFLOAD_STATUS operation, but that operation does not carry a write verifier in its result. Neither does it carry a stable_how4 value, so the client /must/ send a COMMIT in this case -- which will always fail because currently there's still no write verifier in the COPY result. Thus the server needs to return a normal write verifier in its COPY result even if the COPY operation is to be performed asynchronously. If the server recognizes the callback stateid in subsequent OFFLOAD_STATUS operations, then obviously it has not restarted, and the write verifier the client received in the COPY result is still valid and can be used to assess a COMMIT of the copied data, if one is needed. Reviewed-by:Jeff Layton <jlayton@kernel.org> [ cel: adjusted to apply to origin/linux-6.6.y ] Signed-off-by:
Chuck Lever <chuck.lever@oracle.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 20a10c78ac3a8b608dca7c42bd6a982b192f55dd) Conflicts: fs/nfsd/nfs4proc.c [commit: "NFSD: Limit the number of concurrent async COPY operations" merged early] Signed-off-by:
Wentao Guan <guanwentao@uniontech.com>