diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/inode.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 0a972ee9ccc1..e5070aa5f175 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -1038,24 +1038,24 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) | |||
1038 | nfs_wait_bit_killable, TASK_KILLABLE); | 1038 | nfs_wait_bit_killable, TASK_KILLABLE); |
1039 | if (ret) | 1039 | if (ret) |
1040 | goto out; | 1040 | goto out; |
1041 | if (!(nfsi->cache_validity & NFS_INO_INVALID_DATA)) | 1041 | spin_lock(&inode->i_lock); |
1042 | goto out; | 1042 | if (test_bit(NFS_INO_INVALIDATING, bitlock)) { |
1043 | if (!test_and_set_bit_lock(NFS_INO_INVALIDATING, bitlock)) | 1043 | spin_unlock(&inode->i_lock); |
1044 | continue; | ||
1045 | } | ||
1046 | if (nfsi->cache_validity & NFS_INO_INVALID_DATA) | ||
1044 | break; | 1047 | break; |
1045 | } | ||
1046 | |||
1047 | spin_lock(&inode->i_lock); | ||
1048 | if (nfsi->cache_validity & NFS_INO_INVALID_DATA) { | ||
1049 | nfsi->cache_validity &= ~NFS_INO_INVALID_DATA; | ||
1050 | spin_unlock(&inode->i_lock); | ||
1051 | trace_nfs_invalidate_mapping_enter(inode); | ||
1052 | ret = nfs_invalidate_mapping(inode, mapping); | ||
1053 | trace_nfs_invalidate_mapping_exit(inode, ret); | ||
1054 | } else { | ||
1055 | /* something raced in and cleared the flag */ | ||
1056 | spin_unlock(&inode->i_lock); | 1048 | spin_unlock(&inode->i_lock); |
1049 | goto out; | ||
1057 | } | 1050 | } |
1058 | 1051 | ||
1052 | set_bit(NFS_INO_INVALIDATING, bitlock); | ||
1053 | nfsi->cache_validity &= ~NFS_INO_INVALID_DATA; | ||
1054 | spin_unlock(&inode->i_lock); | ||
1055 | trace_nfs_invalidate_mapping_enter(inode); | ||
1056 | ret = nfs_invalidate_mapping(inode, mapping); | ||
1057 | trace_nfs_invalidate_mapping_exit(inode, ret); | ||
1058 | |||
1059 | clear_bit_unlock(NFS_INO_INVALIDATING, bitlock); | 1059 | clear_bit_unlock(NFS_INO_INVALIDATING, bitlock); |
1060 | smp_mb__after_clear_bit(); | 1060 | smp_mb__after_clear_bit(); |
1061 | wake_up_bit(bitlock, NFS_INO_INVALIDATING); | 1061 | wake_up_bit(bitlock, NFS_INO_INVALIDATING); |