Commit 0fd7e7a1 authored by Leo Martins's avatar Leo Martins Committed by David Sterba
Browse files

btrfs: fix delayed_node ref_tracker use after free



Move the print before releasing the delayed node.

In my initial testing there was a bug that was causing delayed_nodes
to not get freed which is why I put the print after the release. This
obviously neglects the case where the delayed node is properly freed.

Add condition to make sure we only print if we have more than one
reference to the delayed_node to prevent printing when we only have
the reference taken in btrfs_kill_all_delayed_nodes().

Fixes: b767a28d ("btrfs: print leaked references in kill_all_delayed_nodes()")
Tested-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarLeo Martins <loemra.dev@gmail.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 1fabe43b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment