]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSv4.2: fix handling of COPY ERR_OFFLOAD_NO_REQ
authorOlga Kornievskaia <kolga@netapp.com>
Thu, 24 Aug 2023 20:43:53 +0000 (16:43 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Sep 2023 10:22:43 +0000 (12:22 +0200)
[ Upstream commit 5690eed941ab7e33c3c3d6b850100cabf740f075 ]

If the client sent a synchronous copy and the server replied with
ERR_OFFLOAD_NO_REQ indicating that it wants an asynchronous
copy instead, the client should retry with asynchronous copy.

Fixes: 539f57b3e0fd ("NFS handle COPY ERR_OFFLOAD_NO_REQS")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs42proc.c

index bc07012741cb473073da86fa2bd396dd1c1a81ca..2975bbc33d28018c1c207a0f5871dfb2e0e6d78e 100644 (file)
@@ -462,8 +462,9 @@ ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src,
                                continue;
                        }
                        break;
-               } else if (err == -NFS4ERR_OFFLOAD_NO_REQS && !args.sync) {
-                       args.sync = true;
+               } else if (err == -NFS4ERR_OFFLOAD_NO_REQS &&
+                               args.sync != res.synchronous) {
+                       args.sync = res.synchronous;
                        dst_exception.retry = 1;
                        continue;
                } else if ((err == -ESTALE ||