Commit 2f2b6d0b authored by Chuck Lever's avatar Chuck Lever
Browse files

NFSD: OFFLOAD_CANCEL should mark an async COPY as completed



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: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent 82f2b0b9
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);
}