Return-Path: Received: from mail-qk1-f194.google.com ([209.85.222.194]:34595 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727181AbeJSXgO (ORCPT ); Fri, 19 Oct 2018 19:36:14 -0400 Received: by mail-qk1-f194.google.com with SMTP id p6-v6so21261663qkg.1 for ; Fri, 19 Oct 2018 08:29:39 -0700 (PDT) From: Olga Kornievskaia To: trondmy@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v1 07/11] NFS also send OFFLOAD_CANCEL to source server Date: Fri, 19 Oct 2018 11:29:28 -0400 Message-Id: <20181019152932.32462-8-olga.kornievskaia@gmail.com> In-Reply-To: <20181019152932.32462-1-olga.kornievskaia@gmail.com> References: <20181019152932.32462-1-olga.kornievskaia@gmail.com> Sender: linux-nfs-owner@vger.kernel.org List-ID: From: Olga Kornievskaia In case of copy is cancelled, also send OFFLOAD_CANCEL to the source server. Signed-off-by: Olga Kornievskaia --- fs/nfs/nfs42proc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index bb9e799..98fe00b 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -205,12 +205,14 @@ static int handle_async_copy(struct nfs42_copy_res *res, memcpy(&res->write_res.verifier, ©->verf, sizeof(copy->verf)); status = -copy->error; +out_free: kfree(copy); return status; out_cancel: nfs42_do_offload_cancel_async(dst, ©->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, -- 1.8.3.1