summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2026-10-01 17:21:22 +0100
committerDavid Sterba <dsterba@suse.com>2026-10-12 19:16:24 +0200
commit0388b5bd3a6eb8bcb20208c3b6dbee96fd30bbe0 (patch)
tree6dfa96e6c307e4e45c462346019d870fff337edb /tools/perf/scripts/python
parent9421d1897ba2185cd2c3cf7bf517fd99d4f58516 (diff)
downloadlinux-0388b5bd3a6eb8bcb20208c3b6dbee96fd30bbe0.tar.gz
linux-0388b5bd3a6eb8bcb20208c3b6dbee96fd30bbe0.zip
btrfs: qgroup: fix swapped blocks existence check when tracing after COW
In btrfs_qgroup_trace_subtree_after_cow(), after we erase the swapped block, iterate over all possible tree levels to check if we sill have other swapped blocks. However the check is wrong, it considers that there are other swapped blocks if any rbtree for any level is empty, instead of not empty. As a consequence we set blocks->swapped to true basically every time since we always find an empty rbtree at least at level 7, since in practice it's nearly impossible to find such a huge btree. This makes every future call to btrfs_qgroup_trace_subtree_after_cow() do an unnecessary rbtree search instead of returning immediately. Fix this by updating the condition to set swapped to true if we find an rbtree that is not empty. Fixes: f616f5cd9da7 ("btrfs: qgroup: Use delayed subtree rescan for balance") Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions