From patchwork Fri Oct 19 15:29:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10649673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 49689181D for ; Fri, 19 Oct 2018 15:29:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 37F2127F8E for ; Fri, 19 Oct 2018 15:29:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C14327F92; Fri, 19 Oct 2018 15:29:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2E5627F8E for ; Fri, 19 Oct 2018 15:29:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727235AbeJSXgO (ORCPT ); Fri, 19 Oct 2018 19:36:14 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DqnHnZrMSvA0or48b6pnWzyYDz4iWYc8+TMTuA2+K94=; b=Mm3hz+xkI0cng0fqX4MjF9WLy6A6v1lyl8dbyHQ+HuvIr7Bx0Wi5lbwU0c4nErBVIC mpTmcLv97Mqc62LHfzSvbPHfLUqG/a1aCCUV0qZkSdDEDdue0PsDp6c0jxWRC1vxgSRN BRDwgKKEKocLs0zJw7a0LA5Rv28/OXNXbzvajrxYonD6OmlGRgZ6Mo4YkTo4JfnnbX37 jOcG4PyqI2YXk+IU1phVWfzQvlAYKsWCL3HT0vJ0qvrKgLgyV7COqxY3SWb9F18cgIOp vf+d8VwhbXBQQjkBKTym5fZ/YoTBWgjdnMoifO0XgqD0ZxM9Je+v53gtUDP8fjfLMkbS TOig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DqnHnZrMSvA0or48b6pnWzyYDz4iWYc8+TMTuA2+K94=; b=FuAmXdWq5vRDIUW0nYb82kQCAhQts65DyYYCnhcztAKQ49cYsnZ6q9PvcnpaPTpAEt CCYTUTKXhQTqx8v23on+mZEfLuRjiePcXyURzKaDmdHCOz5THP9qh4Nl20vtVefzRpDT QrhzwYV8N3Wm64+NMA8l+ukLYWgDxYGvdpq1gThDOyXrYks55SxLY7be/SrjWF3Xe5bl dyCAnXQ7Y38ywjAR5jz5Hc/mUKO8KR2vbjAJ6to7RyUN66duVcnFfc67CMtaZQS0y0Vp DFD7IDWcUdMNUzD9uIFJHP5Fr6ZBTQ0GEIO731T7GBw0uiFJAZDFy3GZ04tddfKCQPF2 nL3w== X-Gm-Message-State: AGRZ1gLPqATcOFd2kES4M2nUM+npEfvkTYvzJP86M21rTEeXegtt8nAb 2KSs2L2lIz69poSuuK6AN28= X-Google-Smtp-Source: ACcGV634++TpdX9TQN+85+WPbbzBjxDViBuOh6NVocq558xwq5OxspbzchAwXOs597ZHQ0nI1bxkzg== X-Received: by 2002:a37:29c3:: with SMTP id p64-v6mr5782699qkp.77.1539962979087; Fri, 19 Oct 2018 08:29:39 -0700 (PDT) Received: from Olgas-MBP-195.attlocal.net (172-10-226-31.lightspeed.livnmi.sbcglobal.net. [172.10.226.31]) by smtp.gmail.com with ESMTPSA id w39-v6sm17358099qtc.84.2018.10.19.08.29.37 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 19 Oct 2018 08:29:38 -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> X-Mailer: git-send-email 2.10.1 (Apple Git-78) 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 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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,