diff options
-rw-r--r-- | fs/btrfs/transaction.c | 6 | ||||
-rw-r--r-- | fs/btrfs/transaction.h | 6 |
2 files changed, 12 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; |
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h index fe27379e368b..010729446e13 100644 --- a/fs/btrfs/transaction.h +++ b/fs/btrfs/transaction.h | |||
@@ -57,6 +57,12 @@ struct btrfs_trans_handle { | |||
57 | struct btrfs_block_rsv *block_rsv; | 57 | struct btrfs_block_rsv *block_rsv; |
58 | struct btrfs_block_rsv *orig_rsv; | 58 | struct btrfs_block_rsv *orig_rsv; |
59 | int aborted; | 59 | int aborted; |
60 | /* | ||
61 | * this root is only needed to validate that the root passed to | ||
62 | * start_transaction is the same as the one passed to end_transaction. | ||
63 | * Subvolume quota depends on this | ||
64 | */ | ||
65 | struct btrfs_root *root; | ||
60 | }; | 66 | }; |
61 | 67 | ||
62 | struct btrfs_pending_snapshot { | 68 | struct btrfs_pending_snapshot { |