btrfs: warn if leaking delayed_nodes in btrfs_put_root()
Add a warning for leaked delayed_nodes when putting a root. We currently do this for inodes, but not delayed_nodes. Signed-off-by: Leo Martins <loemra.dev@gmail.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: Qu Wenruo <wqu@suse.com> [ Remove the changelog from the commit message. ] Signed-off-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
dd276214e4
commit
186b9dc3c3
@@ -1835,6 +1835,8 @@ void btrfs_put_root(struct btrfs_root *root)
|
||||
if (refcount_dec_and_test(&root->refs)) {
|
||||
if (WARN_ON(!xa_empty(&root->inodes)))
|
||||
xa_destroy(&root->inodes);
|
||||
if (WARN_ON(!xa_empty(&root->delayed_nodes)))
|
||||
xa_destroy(&root->delayed_nodes);
|
||||
WARN_ON(test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state));
|
||||
if (root->anon_dev)
|
||||
free_anon_bdev(root->anon_dev);
|
||||
|
||||
Reference in New Issue
Block a user