From: Liu Bo Date: Wed, 13 Mar 2013 13:43:03 +0000 (-0600) Subject: Btrfs: fix warning when creating snapshots X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7c2ec3f0730729f4829d01f7c19538d135f86712;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Chris Mason --- 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, 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; }