]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
NFSD: OFFLOAD_CANCEL should mark an async COPY as completed
authorChuck Lever <chuck.lever@oracle.com>
Sat, 1 Mar 2025 18:31:47 +0000 (13:31 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Sun, 11 May 2025 23:48:19 +0000 (19:48 -0400)
Update the status of an async COPY operation when it has been
stopped. OFFLOAD_STATUS needs to indicate that the COPY is no longer
running.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4proc.c

index b397246dae7b7e8c2a0ba436bb3813213cfe4fa2..fc19886cf9aafc67f573c953a423ab1e55cc638c 100644 (file)
@@ -1379,8 +1379,11 @@ static void nfs4_put_copy(struct nfsd4_copy *copy)
 static void nfsd4_stop_copy(struct nfsd4_copy *copy)
 {
        trace_nfsd_copy_async_cancel(copy);
-       if (!test_and_set_bit(NFSD4_COPY_F_STOPPED, &copy->cp_flags))
+       if (!test_and_set_bit(NFSD4_COPY_F_STOPPED, &copy->cp_flags)) {
                kthread_stop(copy->copy_task);
+               copy->nfserr = nfs_ok;
+               set_bit(NFSD4_COPY_F_COMPLETED, &copy->cp_flags);
+       }
        nfs4_put_copy(copy);
 }