aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/transaction.c
diff options
context:
space:
mode:
authorArne Jansen <sensille@gmx.net>2011-09-13 05:40:09 -0400
committerJan Schmidt <list.btrfs@jan-o-sch.net>2012-07-10 09:14:43 -0400
commitd13603ef6e14a12cd65a6975e8117c0fea7c7ddf (patch)
tree9f6a11b5b8963f0663a47c7bbe73d698fb0cff71 /fs/btrfs/transaction.c
parent2f38b3e1900634e64a186873b3388b1bf85dabc0 (diff)
Btrfs: check the root passed to btrfs_end_transaction
This patch only add a consistancy check to validate that the same root is passed to start_transaction and end_transaction. Subvolume quota depends on this. Signed-off-by: Arne Jansen <sensille@gmx.net>
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r--fs/btrfs/transaction.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 621c8dc48fb6..23cbda0685b8 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -345,6 +345,7 @@ again:
345 h->transaction = cur_trans; 345 h->transaction = cur_trans;
346 h->blocks_used = 0; 346 h->blocks_used = 0;
347 h->bytes_reserved = 0; 347 h->bytes_reserved = 0;
348 h->root = root;
348 h->delayed_ref_updates = 0; 349 h->delayed_ref_updates = 0;
349 h->use_count = 1; 350 h->use_count = 1;
350 h->block_rsv = NULL; 351 h->block_rsv = NULL;
@@ -511,6 +512,11 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
511 512
512 btrfs_trans_release_metadata(trans, root); 513 btrfs_trans_release_metadata(trans, root);
513 trans->block_rsv = NULL; 514 trans->block_rsv = NULL;
515 /*
516 * the same root has to be passed to start_transaction and
517 * end_transaction. Subvolume quota depends on this.
518 */
519 WARN_ON(trans->root != root);
514 while (count < 2) { 520 while (count < 2) {
515 unsigned long cur = trans->delayed_ref_updates; 521 unsigned long cur = trans->delayed_ref_updates;
516 trans->delayed_ref_updates = 0; 522 trans->delayed_ref_updates = 0;