diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-12 00:19:38 +0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-29 00:03:05 +0400 |
commit | dcfc4f25461813e8a2dd43b052aa1e0be155742f (patch) | |
tree | 82edc73de99f2ce16fa9072964337699158abd34 /fs/nfs/nfs4file.c | |
parent | 05990d1bf2708b9e84d67074551f964d3738eedc (diff) | |
download | linux-dcfc4f25461813e8a2dd43b052aa1e0be155742f.tar.xz |
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/nfs4file.c')
-rw-r--r-- | fs/nfs/nfs4file.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfs/nfs4file.c b/fs/nfs/nfs4file.c index eef1b38a1b08..afddd6639afb 100644 --- a/fs/nfs/nfs4file.c +++ b/fs/nfs/nfs4file.c @@ -105,6 +105,13 @@ nfs4_file_fsync(struct file *file, loff_t start, loff_t end, int datasync) /* application has asked for meta-data sync */ ret = pnfs_layoutcommit_inode(inode, true); 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; |