[v6,04/19] NFS: also send OFFLOAD_CANCEL to source server
diff mbox series

Message ID 20190906194631.3216-5-olga.kornievskaia@gmail.com
State New
Headers show
  • client and server support for "inter" SSC copy
Related show

Commit Message

Olga Kornievskaia Sept. 6, 2019, 7:46 p.m. UTC
From: Olga Kornievskaia <kolga@netapp.com>

In case of copy is cancelled, also send OFFLOAD_CANCEL to the source

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
 fs/nfs/nfs42proc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff mbox series

diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index e34ade8..bbf7c1e 100644
--- a/fs/nfs/nfs42proc.c
+++ b/fs/nfs/nfs42proc.c
@@ -206,12 +206,14 @@  static int handle_async_copy(struct nfs42_copy_res *res,
 	memcpy(&res->write_res.verifier, &copy->verf, sizeof(copy->verf));
 	status = -copy->error;
 	return status;
 	nfs42_do_offload_cancel_async(dst, &copy->stateid);
-	kfree(copy);
-	return status;
+	if (!nfs42_files_from_same_server(src, dst))
+		nfs42_do_offload_cancel_async(src, src_stateid);
+	goto out_free;
 static int process_copy_commit(struct file *dst, loff_t pos_dst,