aboutsummaryrefslogtreecommitdiff
path: root/include/linux/fpga/fpga-mgr.h
diff options
context:
space:
mode:
authorNaohiro Aota <[email protected]>2021-05-27 15:27:32 +0900
committerDavid Sterba <[email protected]>2021-06-04 13:11:50 +0200
commit5b434df8778771d181bc19fb4593bca114d1c4eb (patch)
tree7624ad69ad0208990c115a9794e72341f5347758 /include/linux/fpga/fpga-mgr.h
parent165ea85f14831f27fc6fe3b02b35e42e50b9ed94 (diff)
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 <[email protected]> Fixes: 12659251ca5d ("btrfs: implement log-structured superblock for ZONED mode") CC: [email protected] # 5.11+ Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Naohiro Aota <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
Diffstat (limited to 'include/linux/fpga/fpga-mgr.h')
0 files changed, 0 insertions, 0 deletions