summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2012-09-06 12:04:27 +0200
committerChris Mason <chris.mason@fusionio.com>2012-10-01 21:19:12 +0200
commit2ecb79239bcd04c9d410f4cdce16adb6840b19da (patch)
tree9a2194dde73a1a822fa011c35745c3aafa316f86 /fs/btrfs/ctree.h
parentBtrfs: fix wrong size for the reservation of the, snapshot creation (diff)
downloadlinux-2ecb79239bcd04c9d410f4cdce16adb6840b19da.tar.xz
linux-2ecb79239bcd04c9d410f4cdce16adb6840b19da.zip
Btrfs: fix unprotected ->log_batch
We forget to protect ->log_batch when syncing a file, this patch fix this problem by atomic operation. And ->log_batch is used to check if there are parallel sync operations or not, so it is unnecessary to reset it to 0 after the sync operation of the current log tree complete. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 2990a7ea6248..6923b9e4f90d 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -1491,9 +1491,9 @@ struct btrfs_root {
wait_queue_head_t log_commit_wait[2];
atomic_t log_writers;
atomic_t log_commit[2];
+ atomic_t log_batch;
unsigned long log_transid;
unsigned long last_log_commit;
- unsigned long log_batch;
pid_t log_start_pid;
bool log_multiple_pids;