nfs: add memory barriers around NFS_INO_INVALID_DATA and NFS_INO_INVALIDATING
authorJeff Layton <jlayton@redhat.com>
Tue, 28 Jan 2014 18:47:46 +0000 (13:47 -0500)
committerJiri Slaby <jslaby@suse.cz>
Thu, 3 Apr 2014 08:32:18 +0000 (10:32 +0200)
commitfca36cf65b30ce5abb69284ba5404eb4d03f9545
tree8059f012441243ed5bbd55bb800e22ca8a768e63
parent2791fc92400a2a504eda346688eeb40949e5e1ba
nfs: add memory barriers around NFS_INO_INVALID_DATA and NFS_INO_INVALIDATING

commit 4db72b40fdbc706f8957e9773ae73b1574b8c694 upstream.

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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/nfs/dir.c
fs/nfs/inode.c
fs/nfs/write.c