aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tests/btrfs-tests.c
diff options
context:
space:
mode:
authorNikolay Borisov <[email protected]>2018-08-15 15:26:57 +0000
committerDavid Sterba <[email protected]>2018-12-17 13:51:31 +0000
commit9cfc8ba712be5abd476532bf672389f67e41f4ff (patch)
treeabc79e3d7a138b427970356cc3d3f2d408ac500e /fs/btrfs/tests/btrfs-tests.c
parentbtrfs: Remove unnecessary tree locking code in qgroup_rescan_leaf (diff)
downloadkernel-9cfc8ba712be5abd476532bf672389f67e41f4ff.tar.gz
kernel-9cfc8ba712be5abd476532bf672389f67e41f4ff.zip
btrfs: Remove special handling of EXTENT_BUFFER_UNMAPPED while freeing
Now that the whole of btrfs code has been audited for eb reference count management it's time to remove the hunk in free_extent_buffer that essentially considered the condition "eb->ref == 2 && EXTENT_BUFFER_DUMMY" to equal "eb->ref = 1". Also remove the last location which takes an extra reference count in alloc_test_extent_buffer. Signed-off-by: Nikolay Borisov <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'fs/btrfs/tests/btrfs-tests.c')
-rw-r--r--fs/btrfs/tests/btrfs-tests.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c
index db72b3b6209e..4cb8fcfd3ec4 100644
--- a/fs/btrfs/tests/btrfs-tests.c
+++ b/fs/btrfs/tests/btrfs-tests.c
@@ -174,8 +174,12 @@ void btrfs_free_dummy_root(struct btrfs_root *root)
/* Will be freed by btrfs_free_fs_roots */
if (WARN_ON(test_bit(BTRFS_ROOT_IN_RADIX, &root->state)))
return;
- if (root->node)
+ if (root->node) {
+ /* One for allocate_extent_buffer */
free_extent_buffer(root->node);
+ /* One for get_exent_buffer */
+ free_extent_buffer(root->node);
+ }
kfree(root);
}