aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4file.c
diff options
context:
space:
mode:
authorOlga Kornievskaia <kolga@netapp.com>2018-08-13 15:33:01 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2018-08-13 17:04:23 -0400
commite4648aa4f98a87cf0a83f73a5864cede073053a0 (patch)
treec6e48236e743a8be03bf7062d33e98d8e550aecb /fs/nfs/nfs4file.c
parentNFS add a simple sync nfs4_proc_commit after async COPY (diff)
downloadlinux-dev-e4648aa4f98a87cf0a83f73a5864cede073053a0.tar.xz
linux-dev-e4648aa4f98a87cf0a83f73a5864cede073053a0.zip
NFS recover from destination server reboot for copies
Mark the destination state to indicate a server-side copy is happening. On detecting a reboot and recovering open state check if any state is engaged in a server-side copy, if so, find the copy and mark it and then signal the waiting thread. Upon wakeup, if copy was marked then propage EAGAIN to the nfsd_copy_file_range and restart the copy from scratch. Signed-off-by: Olga Kornievskaia <kolga@netapp.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/nfs4file.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c
index 6c03d6b570b2..4288a6ecaf75 100644
--- a/fs/nfs/nfs4file.c
+++ b/fs/nfs/nfs4file.c
@@ -133,10 +133,15 @@ static ssize_t nfs4_copy_file_range(struct file *file_in, loff_t pos_in,
struct file *file_out, loff_t pos_out,
size_t count, unsigned int flags)
{
+ ssize_t ret;
+
if (file_inode(file_in) == file_inode(file_out))
return -EINVAL;
-
- return nfs42_proc_copy(file_in, pos_in, file_out, pos_out, count);
+retry:
+ ret = nfs42_proc_copy(file_in, pos_in, file_out, pos_out, count);
+ if (ret == -EAGAIN)
+ goto retry;
+ return ret;
}
static loff_t nfs4_file_llseek(struct file *filep, loff_t offset, int whence)