aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tests/btrfs-tests.c
diff options
context:
space:
mode:
authorJosef Bacik <[email protected]>2020-01-24 14:33:00 +0000
committerDavid Sterba <[email protected]>2020-03-23 16:01:33 +0000
commitbd647ce385ec110fe7796267b6555873e48e44eb (patch)
tree602f2951852f058de5c5debfb4f293f67cec8115 /fs/btrfs/tests/btrfs-tests.c
parentbtrfs: make the init of static elements in fs_info separate (diff)
downloadkernel-bd647ce385ec110fe7796267b6555873e48e44eb.tar.gz
kernel-bd647ce385ec110fe7796267b6555873e48e44eb.zip
btrfs: add a leak check for roots
Now that we're going to start relying on getting ref counting right for roots, add a list to track allocated roots and print out any roots that aren't freed up at free_fs_info time. Hide this behind CONFIG_BTRFS_DEBUG because this will just be used for developers to verify they aren't breaking things. Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: Josef Bacik <[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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c
index 683381a692bc..609abca4fe3a 100644
--- a/fs/btrfs/tests/btrfs-tests.c
+++ b/fs/btrfs/tests/btrfs-tests.c
@@ -193,6 +193,7 @@ void btrfs_free_dummy_fs_info(struct btrfs_fs_info *fs_info)
btrfs_free_fs_roots(fs_info);
cleanup_srcu_struct(&fs_info->subvol_srcu);
kfree(fs_info->super_copy);
+ btrfs_check_leaked_roots(fs_info);
kfree(fs_info->fs_devices);
kfree(fs_info);
}