From patchwork Thu Mar 2 16:01:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 9600887 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E076D60414 for ; Thu, 2 Mar 2017 16:16:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D129728599 for ; Thu, 2 Mar 2017 16:16:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C60B9285B5; Thu, 2 Mar 2017 16:16:23 +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=-6.9 required=2.0 tests=BAYES_00,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 6541D28599 for ; Thu, 2 Mar 2017 16:16:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbdCBQPi (ORCPT ); Thu, 2 Mar 2017 11:15:38 -0500 Received: from mx141.netapp.com ([216.240.21.12]:36004 "EHLO mx141.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752854AbdCBQPB (ORCPT ); Thu, 2 Mar 2017 11:15:01 -0500 X-IronPort-AV: E=Sophos;i="5.35,232,1484035200"; d="scan'208";a="186942020" Received: from vmwexchts01-prd.hq.netapp.com ([10.122.105.12]) by mx141-out.netapp.com with ESMTP; 02 Mar 2017 07:52:58 -0800 Received: from smtp2.corp.netapp.com (10.57.159.114) by VMWEXCHTS01-PRD.hq.netapp.com (10.122.105.12) with Microsoft SMTP Server id 15.0.1210.3; Thu, 2 Mar 2017 08:01:31 -0800 Received: from localhost.localdomain ([10.63.239.5]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id v22G1KHh017525; Thu, 2 Mar 2017 08:01:33 -0800 (PST) From: Olga Kornievskaia To: CC: Subject: [RFC v1 16/19] NFS handle COPY ERR_OFFLOAD_NO_REQS Date: Thu, 2 Mar 2017 11:01:20 -0500 Message-ID: <20170302160123.30375-17-kolga@netapp.com> X-Mailer: git-send-email 2.10.1 (Apple Git-78) In-Reply-To: <20170302160123.30375-1-kolga@netapp.com> References: <20170302160123.30375-1-kolga@netapp.com> MIME-Version: 1.0 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 If client sent async COPY and server replied with ERR_OFFLOAD_NO_REQS, client should retry with a synchronous copy. Signed-off-by: Olga Kornievskaia --- fs/nfs/nfs42proc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index b29f2c9..c9d8d7a 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -273,10 +273,17 @@ static ssize_t _nfs42_proc_copy(struct file *src, if (status) return status; +retry: args->sync = sync; status = nfs4_call_sync(server->client, server, &msg, &args->seq_args, &res->seq_res, 0); switch (status) { + case -NFS4ERR_OFFLOAD_NO_REQS: + if (!sync) { + sync = true; + goto retry; + } + break; case -ENOTSUPP: server->caps &= ~NFS_CAP_COPY; break;