Commit d734492a authored by Naohiro Aota's avatar Naohiro Aota Committed by David Sterba

btrfs: zoned: use sector_t for zone sectors

We need to use sector_t for zone_sectors, or it would set the zone size
to zero when the size >= 4GB (= 2^24 sectors) by shifting the
zone_sectors value by SECTOR_SHIFT. We're assuming zones sizes up to
8GiB.

Fixes: 5b316468 ("btrfs: get zone information of zoned block devices")
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarNaohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c28ea613
...@@ -269,7 +269,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device) ...@@ -269,7 +269,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device)
sector_t sector = 0; sector_t sector = 0;
struct blk_zone *zones = NULL; struct blk_zone *zones = NULL;
unsigned int i, nreported = 0, nr_zones; unsigned int i, nreported = 0, nr_zones;
unsigned int zone_sectors; sector_t zone_sectors;
char *model, *emulated; char *model, *emulated;
int ret; int ret;
...@@ -658,7 +658,7 @@ int btrfs_sb_log_location_bdev(struct block_device *bdev, int mirror, int rw, ...@@ -658,7 +658,7 @@ int btrfs_sb_log_location_bdev(struct block_device *bdev, int mirror, int rw,
u64 *bytenr_ret) u64 *bytenr_ret)
{ {
struct blk_zone zones[BTRFS_NR_SB_LOG_ZONES]; struct blk_zone zones[BTRFS_NR_SB_LOG_ZONES];
unsigned int zone_sectors; sector_t zone_sectors;
u32 sb_zone; u32 sb_zone;
int ret; int ret;
u8 zone_sectors_shift; u8 zone_sectors_shift;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment