summaryrefslogtreecommitdiff
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2015-02-16 21:36:47 +0300
committerDavid Sterba <dsterba@suse.com>2015-10-10 19:40:04 +0300
commita83342aa0c8f0ca90057d3837ae8d198186e5153 (patch)
tree723d60098638e0f048ae630399d2f77d0e1a0c9d /fs/btrfs/transaction.c
parent33a9eca7e4a4c2c17aebbb11f0e506a48ebc30c9 (diff)
downloadlinux-a83342aa0c8f0ca90057d3837ae8d198186e5153.tar.xz
btrfs: add comments to barriers before waitqueue_active
Reduce number of undocumented barriers out there. Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index e8e5b5a10719..3fd70f797b7d 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -861,6 +861,9 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
atomic_dec(&cur_trans->num_writers);
extwriter_counter_dec(cur_trans, trans->type);
+ /*
+ * Make sure counter is updated before we wake up waiters.
+ */
smp_mb();
if (waitqueue_active(&cur_trans->writer_wait))
wake_up(&cur_trans->writer_wait);