Skip to content

Commit 186b9dc

Browse files
loemrawkdave
authored andcommitted
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 <[email protected]> Reviewed-by: Filipe Manana <[email protected]> Reviewed-by: Qu Wenruo <[email protected]> [ Remove the changelog from the commit message. ] Signed-off-by: Qu Wenruo <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent dd27621 commit 186b9dc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/disk-io.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,8 @@ void btrfs_put_root(struct btrfs_root *root)
18351835
if (refcount_dec_and_test(&root->refs)) {
18361836
if (WARN_ON(!xa_empty(&root->inodes)))
18371837
xa_destroy(&root->inodes);
1838+
if (WARN_ON(!xa_empty(&root->delayed_nodes)))
1839+
xa_destroy(&root->delayed_nodes);
18381840
WARN_ON(test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state));
18391841
if (root->anon_dev)
18401842
free_anon_bdev(root->anon_dev);

0 commit comments

Comments
 (0)