From patchwork Fri Oct 19 15:29:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10649681 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 1E61213A4 for ; Fri, 19 Oct 2018 15:29:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D2E927F8E for ; Fri, 19 Oct 2018 15:29:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01DCE27F92; Fri, 19 Oct 2018 15:29:45 +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 AE5D127F8E for ; Fri, 19 Oct 2018 15:29:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727358AbeJSXgT (ORCPT ); Fri, 19 Oct 2018 19:36:19 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:36593 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727265AbeJSXgT (ORCPT ); Fri, 19 Oct 2018 19:36:19 -0400 Received: by mail-qt1-f194.google.com with SMTP id u34-v6so38718741qth.3 for ; Fri, 19 Oct 2018 08:29:44 -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=fwlJnXfUGTRII/SW0YspOWGhfPFdbZ3Rgyeu7Z/VErM=; b=Tj/U57poK8n676yvPt4qLHLLFnDYCioHgTgtd6e/R6NSl5GcOwL39jNoKg8rN0kC5w JZvwCfAMldnbGsNQ9/te6v/QiU3BXGZS0UXK3dQR0WUOeARevj/K3EonThEs1rfg6/32 32uRLGnh0EIHE5OsFXAimxe13bMJxGBTPnZ4OuBsPkXaE3iUIyDV17WE5qWjtjREevgw cB29LPhNLFfKJpuMs4dppd8zK1NAztimc4UywQRX3VGZrJOC83Oe9PLI2V5t2L/ZJTDW h4MeTbeLDAPWGhjLSAUwgZY4X9IN/evLUQ7MGfsVTGxGyBrgRiGgj+GnDCiTm4cvIPem UktQ== 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=fwlJnXfUGTRII/SW0YspOWGhfPFdbZ3Rgyeu7Z/VErM=; b=VWxWdSAQuy4PdOy3c5EgyDkcwv/XU5nibafWH3h88y0oS+Cj7OBCYl/i3bgLsqLwCY gpenUl6sljYj4k587RcgNYwLtzUKmU0jyedoo6w8DiIBQ1CLRzcEop0SRlMQ/ApBxb6w 5ipwq7f/aSCXGNlQLrQMyEZwqbrYD9zAOkDDobBVafAMOEzQmlsvqZAHtPrAANGx175e dZyS1jl36+ptRZJhEe2hEqBN7akIODQTO/WoQe9duc7/bQR/ALViSPiPz/BykTQXMzCo b5ARarFG5iQdQKgxihwOSHUl5WoQflUiuCDsUwiSAuFdEqLLmyrz5cst2Heh3L2LTnRe A+7A== X-Gm-Message-State: ABuFfohJdtLWnN4xGW63jiEK0VpZiADLLWmkrzsM+FddKmzy+j/0JOeT sMWiU6KEThzWphCb7zb6n5g= X-Google-Smtp-Source: ACcGV63yIUM1mEyI2SHoyhQXuXYmG6p/0uy26eK0G6KbvheljDeIEjumzLZ5vxyktgIdpadQU7G1jw== X-Received: by 2002:aed:33c6:: with SMTP id v64-v6mr15006601qtd.203.1539962983975; Fri, 19 Oct 2018 08:29:43 -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.42 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 19 Oct 2018 08:29:43 -0700 (PDT) From: Olga Kornievskaia To: trondmy@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v1 11/11] NFS COPY handle ERR_OFFLOAD_DENIED Date: Fri, 19 Oct 2018 11:29:32 -0400 Message-Id: <20181019152932.32462-12-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 If server sends ERR_OFFLOAD_DENIED error, the client must fall back on doing copy the normal way. Return ENOTSUPP to the vfs and fallback to regular copy. Signed-off-by: Olga Kornievskaia --- fs/nfs/nfs42proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 00809b3..c7c2ffa 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -395,7 +395,8 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src, args.sync = true; dst_exception.retry = 1; continue; - } else if (err == -ESTALE && + } else if ((err == -ESTALE || + err == -NFS4ERR_OFFLOAD_DENIED) && !nfs42_files_from_same_server(src, dst)) { nfs42_do_offload_cancel_async(src, &args.src_stateid); err = -EOPNOTSUPP;