From: Tigran Mkrtchyan Date: Tue, 7 Feb 2023 17:46:35 +0000 (+0100) Subject: nfs42: do not fail with EIO if ssc returns NFS4ERR_OFFLOAD_DENIED X-Git-Tag: v6.6.17~5484^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4730515378a70064581b27ed112fcfc6f2a379ca;p=platform%2Fkernel%2Flinux-rpi.git nfs42: do not fail with EIO if ssc returns NFS4ERR_OFFLOAD_DENIED The NFSv4.2 server even if supports intra-SSC might prefer that for a particular file a classic copy is performed. As returning ENOTSUPP will clear the SSC capability of the server by the client, server might return NFS4ERR_OFFLOAD_DENIED (well, spec talks about remote servers there). Update nfs42_proc_copy to handle NFS4ERR_OFFLOAD_DENIED as ENOTSUPP, but without clearing NFS_CAP_COPY bit. Signed-off-by: Tigran Mkrtchyan Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c index ecb4285..93e306b 100644 --- a/fs/nfs/nfs42proc.c +++ b/fs/nfs/nfs42proc.c @@ -460,7 +460,8 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src, if (err >= 0) break; - if (err == -ENOTSUPP && + if ((err == -ENOTSUPP || + err == -NFS4ERR_OFFLOAD_DENIED) && nfs42_files_from_same_server(src, dst)) { err = -EOPNOTSUPP; break;