aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2014-01-28 13:47:46 -0500
committerTrond Myklebust <trond.myklebust@primarydata.com>2014-01-28 14:48:18 -0500
commit4db72b40fdbc706f8957e9773ae73b1574b8c694 (patch)
tree7ccf6324c0643b0b35c1ccc0895292f51000685e /fs/nfs/write.c
parent17dfeb9113397a6119091a491ef7182649f0c5a9 (diff)
nfs: add memory barriers around NFS_INO_INVALID_DATA and NFS_INO_INVALIDATING
If the setting of NFS_INO_INVALIDATING gets reordered to before the clearing of NFS_INO_INVALID_DATA, then another task may hit a race window where both appear to be clear, even though the inode's pages are still in need of invalidation. Fix this by adding the appropriate memory barriers. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 5511a4247190..9a3b6a4cd6b9 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -915,6 +915,7 @@ static bool nfs_write_pageuptodate(struct page *page, struct inode *inode)
915 goto out; 915 goto out;
916 if (nfsi->cache_validity & (NFS_INO_INVALID_DATA|NFS_INO_REVAL_PAGECACHE)) 916 if (nfsi->cache_validity & (NFS_INO_INVALID_DATA|NFS_INO_REVAL_PAGECACHE))
917 return false; 917 return false;
918 smp_rmb();
918 if (test_bit(NFS_INO_INVALIDATING, &nfsi->flags)) 919 if (test_bit(NFS_INO_INVALIDATING, &nfsi->flags))
919 return false; 920 return false;
920out: 921out: