diff mbox

[RFC,v3,13/42] NFS handle COPY ERR_OFFLOAD_NO_REQS

Message ID 20170711164416.1982-14-kolga@netapp.com (mailing list archive)
State New, archived
Headers show

Commit Message

Olga Kornievskaia July 11, 2017, 4:43 p.m. UTC
If client sent async COPY and server replied with
ERR_OFFLOAD_NO_REQS, client should retry with a synchronous copy.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/nfs42proc.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox

Patch

diff --git a/fs/nfs/nfs42proc.c b/fs/nfs/nfs42proc.c
index 8223726..dba2b62 100644
--- a/fs/nfs/nfs42proc.c
+++ b/fs/nfs/nfs42proc.c
@@ -309,6 +309,13 @@  ssize_t nfs42_proc_copy(struct file *src, loff_t pos_src,
 				&args, &res);
 		inode_unlock(file_inode(dst));
 		switch (err) {
+		case -NFS4ERR_OFFLOAD_NO_REQS:
+			if (!args.sync) {
+				args.sync = true;
+				dst_exception.retry = 1;
+				continue;
+			}
+			break;
 		case -ENOTSUPP:
 			server->caps &= ~NFS_CAP_COPY;
 			if (nfs42_files_from_same_server(src, dst))