From: Trond Myklebust Date: Sat, 20 Feb 2010 01:03:18 +0000 (-0800) Subject: NFS: Ensure inode is always marked I_DIRTY_DATASYNC, if it has unstable pages X-Git-Tag: v2.6.34-rc1~190^2^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2928db1ffeacc9717c2d5c230d450bcc377b3ae9;p=profile%2Fcommon%2Fkernel-common.git 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 --- diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 704e67d..e40e949 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