Return-Path: 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) 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> 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 List-ID: 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); -- 1.8.3.1