aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 75899a01dded..cd5e82e500cf 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1222,14 +1222,12 @@ int btrfs_sync_file(struct file *file, int datasync)
1222 * the current transaction, we can bail out now without any 1222 * the current transaction, we can bail out now without any
1223 * syncing 1223 * syncing
1224 */ 1224 */
1225 mutex_lock(&root->fs_info->trans_mutex); 1225 smp_mb();
1226 if (BTRFS_I(inode)->last_trans <= 1226 if (BTRFS_I(inode)->last_trans <=
1227 root->fs_info->last_trans_committed) { 1227 root->fs_info->last_trans_committed) {
1228 BTRFS_I(inode)->last_trans = 0; 1228 BTRFS_I(inode)->last_trans = 0;
1229 mutex_unlock(&root->fs_info->trans_mutex);
1230 goto out; 1229 goto out;
1231 } 1230 }
1232 mutex_unlock(&root->fs_info->trans_mutex);
1233 1231
1234 /* 1232 /*
1235 * ok we haven't committed the transaction yet, lets do a commit 1233 * ok we haven't committed the transaction yet, lets do a commit