summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/flamegraph.py
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2026-11-02 19:58:38 +1030
committerDavid Sterba <dsterba@suse.com>2026-11-23 18:20:58 +0100
commit5588a3dd3c651824507ff57522718ea53360d1df (patch)
treee9e929621c478e307c028117a48b73b08d47326c /tools/perf/scripts/python/flamegraph.py
parent6b456f4640f5319f1f3223cba5faddb5970ae809 (diff)
btrfs: reject subvolume ids that do not fit into unsigned long
fs_roots_radix is indexed by unsigned long, so on 32-bit systems the subvolume id is silently truncated to 32 bits, e.g: Subvolume 257 (0x101) and subvolume 4294967553 (0x100000101) will have the same index (0x101) on 32-bit systems. Although this should be very rare, as btrfs can reuse deleted subvolume ids, and there are other limits like anon_dev preventing us from so many subvolumes. But it's still better to address such problems, since 32 bit systems are still widely supported by the kernel. Address such rare problem by: - Add btrfs_check_subvolid() to btrfs_insert_fs_root() So that all subvolumes inserted into the fs radix tree are ensured to be no larger than ULONG_MAX. If there is a high subvolume id, it will show an error message. - Do not search the radix tree if subvolid is is too larger It's possible to pass reloc tree into btrfs_lookup_fs_root() through backref walk. And it can be very common during qgroup operations. So we don't want to flood the dmesg with error messages. Just silently reject such search silently, and searching tree reloc tree inside btrfs_lookup_fs_root() will return nothing anyway. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions