]> Gentwo Git Trees - linux/.git/commit
btrfs: fix delayed_node ref_tracker use after free
authorLeo Martins <loemra.dev@gmail.com>
Mon, 20 Oct 2025 23:16:15 +0000 (16:16 -0700)
committerDavid Sterba <dsterba@suse.com>
Wed, 22 Oct 2025 07:40:04 +0000 (09:40 +0200)
commit0fd7e7a1ad7c5fb8801a9c1661fc4e1ae4d9b655
tree4a75047a3c7c4fb76b611326da84d6ef0d7ed9f0
parent1fabe43b4e1a97597ec5d5ffcd2b7cf96e654b8f
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: b767a28d6154 ("btrfs: print leaked references in kill_all_delayed_nodes()")
Tested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Leo Martins <loemra.dev@gmail.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-inode.c
fs/btrfs/delayed-inode.h