This is a note to let you know that I've just added the patch titled btrfs: zoned: use sector_t for zone sectors to the 5.11-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: btrfs-zoned-use-sector_t-for-zone-sectors.patch and it can be found in the queue-5.11 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit 173462f296ed37dec347187f993a5a43ce8d4910 Author: Naohiro Aota <naohiro.aota@xxxxxxx> Date: Wed Mar 3 17:55:46 2021 +0900 btrfs: zoned: use sector_t for zone sectors [ Upstream commit d734492a14a2da6e7bcce8cf66436a9cf4e51ddf ] 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: 5b316468983d ("btrfs: get zone information of zoned block devices") Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx> Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx> Reviewed-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c index c38846659019..2f80de440359 100644 --- a/fs/btrfs/zoned.c +++ b/fs/btrfs/zoned.c @@ -152,7 +152,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device) sector_t sector = 0; struct blk_zone *zones = NULL; unsigned int i, nreported = 0, nr_zones; - unsigned int zone_sectors; + sector_t zone_sectors; int ret; if (!bdev_is_zoned(bdev)) @@ -485,7 +485,7 @@ int btrfs_sb_log_location_bdev(struct block_device *bdev, int mirror, int rw, u64 *bytenr_ret) { struct blk_zone zones[BTRFS_NR_SB_LOG_ZONES]; - unsigned int zone_sectors; + sector_t zone_sectors; u32 sb_zone; int ret; u64 zone_size;