From patchwork Thu Nov 1 16:45:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10664305 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 744171751 for ; Thu, 1 Nov 2018 16:45:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6337A2C1DD for ; Thu, 1 Nov 2018 16:45:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 574B52C1E7; Thu, 1 Nov 2018 16:45:40 +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=unavailable 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 166FD2C1DD for ; Thu, 1 Nov 2018 16:45:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726564AbeKBBtV (ORCPT ); Thu, 1 Nov 2018 21:49:21 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:33320 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbeKBBtU (ORCPT ); Thu, 1 Nov 2018 21:49:20 -0400 Received: by mail-ot1-f66.google.com with SMTP id q1so8883022otk.0; Thu, 01 Nov 2018 09:45:36 -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=HJvlXEJL0wyQxADnmUn/wBOr9CopicZ9Ch5qLBQ2vRPpVF/awGnSxu2Qd/TyVsZrjo il29p6hpDvz5TNUXiM0kSqQanHvdsAwS4+/+zcodJvNwSW9qBTwI71nHJGarLy8BuXEF /2zF+kotyS2OdOGoREeV5u8jRtSxDu2U6EGU5RZKd2ztPEqxzJebVnFrM4bMPfIWwhXk E8sgdHS/ZLEGL3HH/6JlMDZFr16qQZmPuS8XegBYmx182LcfhviCssYdTP8WzIcRhnVS 9lHsl6KOmv7uZjQo29trioBRWt3egNUo6da6u27dWHJlCSoskylXvDhP/133k5M7F2D1 6ofA== 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=JQ+qjF1GhUCz/sZXJtf2iHfoyzE5Qw8jtnezPlCPLoqDlQsFK8/QxUp6BRF9A+VrHX +5UqDFNrOld0nEZ/+fFMrlk7O5dSOIXd4iMEvoHkdf08qmiRHrARXDT5HyzKrI+YcThz Nkdhes72Z/JuZdd4hhTsaz9vUhvkx2mV0qvKXsr+HGlMc2eApUHF9m6v1cr5asapVMzO kat5T/WYRlKH7ag2gCtJ6o6fEIxtrGOrgfqsswmY/UqE1///VL1BEfAP8s2uBNtDyL3/ a1iKv0v4SzRWAaVF4cp5dcp+VmHK4sQR58T5nUajEhj4T3HvBa8gHz0cSBKdD0o9wIY8 PohQ== X-Gm-Message-State: AGRZ1gLFuddlSEIUmEIAm6crqG0ZGSNmlWe5BNK5gycS9t/Uii2nsIsj xWMLMFgXH6hSRd+7jcVZpZg= X-Google-Smtp-Source: AJdET5fAdMIM6pYUuJeLVzFZh5ySPXFV5LA0jIl/y8KgP2ZmIQFqzzzYYuy08Oh4KpPHTR3GHrYJXQ== X-Received: by 2002:a9d:6511:: with SMTP id i17mr5272361otl.358.1541090735659; Thu, 01 Nov 2018 09:45:35 -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 r62-v6sm1834301oig.14.2018.11.01.09.45.34 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Nov 2018 09:45:34 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, viro@zeniv.linux.org.uk, smfrench@gmail.com, miklos@szeredi.hu Cc: linux-nfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, linux-unionfs@vger.kernel.org Subject: [PATCH v8 06/11] NFS: also send OFFLOAD_CANCEL to source server Date: Thu, 1 Nov 2018 12:45:18 -0400 Message-Id: <20181101164523.41812-7-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20181101164523.41812-1-olga.kornievskaia@gmail.com> References: <20181101164523.41812-1-olga.kornievskaia@gmail.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@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,