diff options
author | Naohiro Aota <naohiro.aota@wdc.com> | 2021-05-27 09:27:32 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-06-04 14:11:50 +0300 |
commit | 5b434df8778771d181bc19fb4593bca114d1c4eb (patch) | |
tree | 7624ad69ad0208990c115a9794e72341f5347758 /tools/perf/scripts/python/flamegraph.py | |
parent | 165ea85f14831f27fc6fe3b02b35e42e50b9ed94 (diff) | |
download | linux-5b434df8778771d181bc19fb4593bca114d1c4eb.tar.xz |
btrfs: zoned: fix zone number to sector/physical calculation
In btrfs_get_dev_zone_info(), we have "u32 sb_zone" and calculate "sector_t
sector" by shifting it. But, this "sector" is calculated in 32bit, leading
it to be 0 for the 2nd superblock copy.
Since zone number is u32, shifting it to sector (sector_t) or physical
address (u64) can easily trigger a missing cast bug like this.
This commit introduces helpers to convert zone number to sector/LBA, so we
won't fall into the same pitfall again.
Reported-by: Dmitry Fomichev <Dmitry.Fomichev@wdc.com>
Fixes: 12659251ca5d ("btrfs: implement log-structured superblock for ZONED mode")
CC: stable@vger.kernel.org # 5.11+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.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