diff options
| author | Guanghui Yang <3497809730@qq.com> | 2026-07-12 03:17:28 +0000 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2026-07-14 07:05:00 +0200 |
| commit | 6a8269b6459ed870a8156c106a0f597383907872 (patch) | |
| tree | a0258dafb252c8c2d213112e43185518aa068fd1 /tools/perf/scripts/python/stackcollapse.py | |
| parent | 9b73625a4f24971d7a1a07df5d7fd58c07bf3f9f (diff) | |
btrfs: free mapping node on duplicate reloc root insert
__add_reloc_root() allocates a mapping_node before inserting it into
rc->reloc_root_tree. If rb_simple_insert() finds an existing entry, it
returns the existing rb_node and leaves the newly allocated node unlinked.
The error path then returns -EEXIST without freeing the new node. Since
the node was never inserted into reloc_root_tree, the later cleanup in
put_reloc_control() cannot find it either.
Free the newly allocated node before returning -EEXIST.
The callers currently assert that -EEXIST should not happen, so this is a
defensive cleanup for an unexpected duplicate insert path. If the path is
ever reached, the local allocation should still be released.
Fixes: 57a304cfd43b ("btrfs: do not panic in __add_reloc_root")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Guanghui Yang <3497809730@qq.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
