Return-Path: Received: from mx143.netapp.com ([216.240.21.24]:18048 "EHLO mx143.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752357AbdI1R2s (ORCPT ); Thu, 28 Sep 2017 13:28:48 -0400 From: Olga Kornievskaia To: , CC: Subject: [PATCH v4 11/11] NFS COPY handle ERR_OFFLOAD_DENIED Date: Thu, 28 Sep 2017 13:28:39 -0400 Message-ID: <20170928172839.50741-12-kolga@netapp.com> In-Reply-To: <20170928172839.50741-1-kolga@netapp.com> References: <20170928172839.50741-1-kolga@netapp.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-nfs-owner@vger.kernel.org List-ID: 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 ff9fa24..7506438 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -387,7 +387,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; -- 1.8.3.1