aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/file.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-11 16:19:38 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-09-28 16:03:05 -0400
commitdcfc4f25461813e8a2dd43b052aa1e0be155742f (patch)
tree82edc73de99f2ce16fa9072964337699158abd34 /fs/nfs/file.c
parentNFS: Fix fdatasync/fsync() when confronted with a server reboot (diff)
downloadlinux-dev-dcfc4f25461813e8a2dd43b052aa1e0be155742f.tar.xz
linux-dev-dcfc4f25461813e8a2dd43b052aa1e0be155742f.zip
NFS: Write the entire file if a server reboot occurs during fsync()
This is to ensure that we don't clear the NFS_CONTEXT_RESEND_WRITES flag while there are still writes that haven't been resent. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/file.c')
-rw-r--r--fs/nfs/file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index cc9b56691bef..c814666bbe7f 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -301,6 +301,13 @@ nfs_file_fsync(struct file *file, loff_t start, loff_t end, int datasync)
mutex_lock(&inode->i_mutex);
ret = nfs_file_fsync_commit(file, start, end, datasync);
mutex_unlock(&inode->i_mutex);
+ /*
+ * If nfs_file_fsync_commit detected a server reboot, then
+ * resend all dirty pages that might have been covered by
+ * the NFS_CONTEXT_RESEND_WRITES flag
+ */
+ start = 0;
+ end = LLONG_MAX;
} while (ret == -EAGAIN);
return ret;