]> git.itanic.dy.fi Git - linux-stable/commit
btrfs: zoned: use sector_t for zone sectors
authorNaohiro Aota <naohiro.aota@wdc.com>
Wed, 3 Mar 2021 08:55:46 +0000 (17:55 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Mar 2021 10:21:23 +0000 (11:21 +0100)
commit8f7d495c1005f022b12bf5636cf241092d256d88
tree041edb1c7cb3810b0688076b943c5acd9dc88185
parentd07bbe4793e5018d3509a7356f19a3bf5213a4db
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@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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/zoned.c