diff options
author | Liu Bo <bo.li.liu@oracle.com> | 2013-03-13 09:43:03 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-03-14 14:57:30 -0400 |
commit | 7c2ec3f0730729f4829d01f7c19538d135f86712 (patch) | |
tree | 562a221897694067b4846233e2a7cf0dbc23aea1 /fs | |
parent | 720f1e2060138855b4a1b1e8aa642f9c7feb6750 (diff) |
Btrfs: fix warning when creating snapshots
Creating snapshot passes extent_root to commit its transaction,
but it can lead to the warning of checking root for quota in
the __btrfs_end_transaction() when someone else is committing
the current transaction. Since we've recorded the needed root
in trans_handle, just use it to get rid of the warning.
Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/transaction.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index fedede1fe178..c4a1531c52d8 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -626,14 +626,13 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, | |||
626 | 626 | ||
627 | btrfs_trans_release_metadata(trans, root); | 627 | btrfs_trans_release_metadata(trans, root); |
628 | trans->block_rsv = NULL; | 628 | trans->block_rsv = NULL; |
629 | /* | ||
630 | * the same root has to be passed to start_transaction and | ||
631 | * end_transaction. Subvolume quota depends on this. | ||
632 | */ | ||
633 | WARN_ON(trans->root != root); | ||
634 | 629 | ||
635 | if (trans->qgroup_reserved) { | 630 | if (trans->qgroup_reserved) { |
636 | btrfs_qgroup_free(root, trans->qgroup_reserved); | 631 | /* |
632 | * the same root has to be passed here between start_transaction | ||
633 | * and end_transaction. Subvolume quota depends on this. | ||
634 | */ | ||
635 | btrfs_qgroup_free(trans->root, trans->qgroup_reserved); | ||
637 | trans->qgroup_reserved = 0; | 636 | trans->qgroup_reserved = 0; |
638 | } | 637 | } |
639 | 638 | ||