mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
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>
This commit is contained in:
committed by
Trond Myklebust
parent
17dfeb9113
commit
4db72b40fd
@@ -915,6 +915,7 @@ static bool nfs_write_pageuptodate(struct page *page, struct inode *inode)
|
||||
goto out;
|
||||
if (nfsi->cache_validity & (NFS_INO_INVALID_DATA|NFS_INO_REVAL_PAGECACHE))
|
||||
return false;
|
||||
smp_rmb();
|
||||
if (test_bit(NFS_INO_INVALIDATING, &nfsi->flags))
|
||||
return false;
|
||||
out:
|
||||
|
||||
Reference in New Issue
Block a user