summaryrefslogtreecommitdiff
path: root/fs/nfs/nfs4file.c
diff options
context:
space:
mode:
authorOlga Kornievskaia <kolga@netapp.com>2019-06-14 14:38:40 -0400
committerOlga Kornievskaia <olga.kornievskaia@gmail.com>2019-10-09 12:06:19 -0400
commit0e65a32c8a569db363048e17a708b1a0913adbef (patch)
treeb95285f447a3148dff7c286f99dc1e317ccc6872 /fs/nfs/nfs4file.c
parentfefa1a812a9ae7ff5647896919dd02b92351c044 (diff)
NFS: handle source server reboot
When the source server reboots after a server-to-server copy was issued, we need to retry the copy from COPY_NOTIFY. We need to detect that the source server rebooted and there is a copy waiting on a destination server and wake it up. Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4file.c')
-rw-r--r--fs/nfs/nfs4file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index a932fc9ca9c4..2af30b7f5bfd 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -146,6 +146,7 @@ static ssize_t __nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
return -EOPNOTSUPP;
if (file_inode(file_in) == file_inode(file_out))
return -EOPNOTSUPP;
+retry:
if (!nfs42_files_from_same_server(file_in, file_out)) {
cn_resp = kzalloc(sizeof(struct nfs42_copy_notify_res),
GFP_NOFS);
@@ -164,6 +165,8 @@ static ssize_t __nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
nss, cnrs);
out:
kfree(cn_resp);
+ if (ret == -EAGAIN)
+ goto retry;
return ret;
}