Skip to content

Commit

Permalink
Btrfs: fix warning when creating snapshots
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
Liu Bo authored and Chris Mason committed Mar 14, 2013
1 parent 720f1e2 commit 7c2ec3f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions fs/btrfs/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,14 +626,13 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,

btrfs_trans_release_metadata(trans, root);
trans->block_rsv = NULL;
/*
* the same root has to be passed to start_transaction and
* end_transaction. Subvolume quota depends on this.
*/
WARN_ON(trans->root != root);

if (trans->qgroup_reserved) {
btrfs_qgroup_free(root, trans->qgroup_reserved);
/*
* the same root has to be passed here between start_transaction
* and end_transaction. Subvolume quota depends on this.
*/
btrfs_qgroup_free(trans->root, trans->qgroup_reserved);
trans->qgroup_reserved = 0;
}

Expand Down

0 comments on commit 7c2ec3f

Please sign in to comment.