summaryrefslogtreecommitdiff
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-02-19 17:03:18 -0800
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-03-05 15:44:54 -0500
commit2928db1ffeacc9717c2d5c230d450bcc377b3ae9 (patch)
treec0dea3d26d45c3ea1a3602984ed4738b93373f67 /fs/nfs/write.c
parent5bad5abec4058c5214bfc72cec418348d6747977 (diff)
downloadlwn-2928db1ffeacc9717c2d5c230d450bcc377b3ae9.tar.gz
lwn-2928db1ffeacc9717c2d5c230d450bcc377b3ae9.zip
NFS: Ensure inode is always marked I_DIRTY_DATASYNC, if it has unstable pages
Since nfs_scan_list() doesn't wait for locked pages, we have a race in which it is possible to end up with an inode that needs to send a COMMIT, but which does not have the I_DIRTY_DATASYNC flag set. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 704e67d392e5..e40e949598fd 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -582,6 +582,8 @@ nfs_scan_commit(struct inode *inode, struct list_head *dst, pgoff_t idx_start, u
ret = nfs_scan_list(nfsi, dst, idx_start, npages, NFS_PAGE_TAG_COMMIT);
if (ret > 0)
nfsi->ncommit -= ret;
+ if (nfs_need_commit(NFS_I(inode)))
+ __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
return ret;
}
#else