summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorrobbieko <robbieko@synology.com>2026-03-25 18:18:15 +0800
committerDavid Sterba <dsterba@suse.com>2026-03-31 06:00:45 +0200
commit316fb1b3169efb081d2db910cbbfef445afa03b9 (patch)
tree43aba06f58e00db23bb82a4c108591323ca90422 /tools
parent1c37d896b12dfd0d4c96e310b0033c6676933917 (diff)
btrfs: fix incorrect return value after changing leaf in lookup_extent_data_ref()
After commit 1618aa3c2e01 ("btrfs: simplify return variables in lookup_extent_data_ref()"), the err and ret variables were merged into a single ret variable. However, when btrfs_next_leaf() returns 0 (success), ret is overwritten from -ENOENT to 0. If the first key in the next leaf does not match (different objectid or type), the function returns 0 instead of -ENOENT, making the caller believe the lookup succeeded when it did not. This can lead to operations on the wrong extent tree item, potentially causing extent tree corruption. Fix this by returning -ENOENT directly when the key does not match, instead of relying on the ret variable. Fixes: 1618aa3c2e01 ("btrfs: simplify return variables in lookup_extent_data_ref()") CC: stable@vger.kernel.org # 6.12+ Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: robbieko <robbieko@synology.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions