From patchwork Fri Oct 19 15:29:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10649679 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 BED61109C for ; Fri, 19 Oct 2018 15:29:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD5D327F8E for ; Fri, 19 Oct 2018 15:29:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1BA227F91; Fri, 19 Oct 2018 15:29:44 +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 5459727F92 for ; Fri, 19 Oct 2018 15:29:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727329AbeJSXgS (ORCPT ); Fri, 19 Oct 2018 19:36:18 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42625 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727265AbeJSXgS (ORCPT ); Fri, 19 Oct 2018 19:36:18 -0400 Received: by mail-qk1-f195.google.com with SMTP id u20-v6so6640826qkk.9 for ; Fri, 19 Oct 2018 08:29:43 -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=K7MFHrnWE4fWFYme7dBc6bdrP0/8P/CPMn5um30ZDY4=; b=jeRyx7XL7uD/c3h/ibAtZOABAIy4/PfWD/IOjJO9PVMxatpKGyjKyuSrjcbWmnAkDG PYkMBz5uXxBeUkc8xSohmSsi4x7KwIsJXMgxxDCTHDHuRhMYREWKj1Lx4Ek37spmOX2a hUOobhNtaZ2LpyQth8tmTOGnGqMTeY6SWNYW3+QxYSQDiLha3om8kqZxYVjo8x1aJkuf Aoo5RWfMDhBbUh20I2y7NKk7owe5CUHlVipKo+AP5zNKXuI7jeu0URNiuHmcNcvQncbL w+jyxOX7UDDgS3FZ8XMxbw4X0zU3NdHXwTcYgCaJg6TueGIqL7z+AIa7sjyRnTQ/COE4 qXnA== 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=K7MFHrnWE4fWFYme7dBc6bdrP0/8P/CPMn5um30ZDY4=; b=Hz3g7gQO5RaTmYI6VKq+m6/vytCg4j/xOw6Kpi+Pl7lbacOeoeq3gBgmjMTLv8mjOz vfTZKMXMSREsRFvFNgOPJs2acjHo0BxMDG8u+gKALrIMacB/TrjgQCgn/k63yhFfSaZK RBJwcGaUODA0IrFEyEjPkWCoFN+L97daij6aWwcFvFTdHcQSHK9iAWQtBRWfu7nvHigK PHt+6vem+4kmiEWrU3QRZmYOAbKm0MU4PYuXYcD12tUP2EQDDmNkBx/BuEN3YTyA5lqX TrqAoT4aq2MbU7vCKnNu03YUrZR9DS2/KGmJlJyipP2XMJRKFvY4BsfADy4URTpc/QIG B69A== X-Gm-Message-State: ABuFfoi4aI4L/a2DZ+kP0e2QNULULTnkyRL0r0YVI2DPpYugnYa4G8qA bU3Nd0+GWM0gbizbhh9a4uI= X-Google-Smtp-Source: ACcGV61BvhKAoQt6sPvq9MyRbgr5o5zVv9/8cFgNHiI69Dq1VkTKMOS6irhcMSNGeL3YTNiNkd/dyA== X-Received: by 2002:a37:dc05:: with SMTP id v5-v6mr33868501qki.141.1539962982745; Fri, 19 Oct 2018 08:29:42 -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.41 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 19 Oct 2018 08:29:42 -0700 (PDT) From: Olga Kornievskaia To: trondmy@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v1 10/11] NFS for "inter" copy treat ESTALE as ENOTSUPP Date: Fri, 19 Oct 2018 11:29:31 -0400 Message-Id: <20181019152932.32462-11-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 the client sends an "inter" copy to the destination server but it only supports "intra" copy, it can return ESTALE (since it doesn't know anything about the file handle from the other server and does not recognize the special case of "inter" copy). Translate this error as ENOTSUPP and also send OFFLOAD_CANCEL to teh source server so that it can clean up state. Signed-off-by: Olga Kornievskaia --- fs/nfs/nfs42proc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index 98fe00b..00809b3 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -395,6 +395,11 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src, args.sync = true; dst_exception.retry = 1; continue; + } else if (err == -ESTALE && + !nfs42_files_from_same_server(src, dst)) { + nfs42_do_offload_cancel_async(src, &args.src_stateid); + err = -EOPNOTSUPP; + break; } err2 = nfs4_handle_exception(server, err, &src_exception);