Btrfs: fix wrong block group in trace during the free space allocation
authorMiao Xie <miaox@cn.fujitsu.com>
Wed, 15 Jan 2014 12:00:57 +0000 (20:00 +0800)
committerChris Mason <clm@fb.com>
Tue, 28 Jan 2014 21:20:40 +0000 (13:20 -0800)
We allocate the free space from the former block group, not the current
one, so should use the former one to output the trace information.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/extent-tree.c

index b55a4fd13ecc6c41c81a029c5f68c6f36fd9f14d..73b55d94b95301a9bdce64964bf6757d202d094d 100644 (file)
@@ -6323,7 +6323,8 @@ have_block_group:
                                /* we have a block, we're done */
                                spin_unlock(&last_ptr->refill_lock);
                                trace_btrfs_reserve_extent_cluster(root,
-                                       block_group, search_start, num_bytes);
+                                               used_block_group,
+                                               search_start, num_bytes);
                                if (used_block_group != block_group) {
                                        btrfs_put_block_group(block_group);
                                        block_group = used_block_group;