mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
ANDROID: f2fs: Fix the calculation of the number of zones
Commit b50e6a61bb ("ANDROID: Revert "f2fs: ensure only power of 2 zone
sizes are allowed"") did not update all code that assumes that the zone
size is a power of two. Hence this (untested) patch.
This issue was discovered by running the following grep command:
git grep -nH ' & .*zone.*- 1'
Bug: 269471019
Change-Id: I9aa4cd1e621f34ed774d89d4f9763981c4b95f50
Signed-off-by: Bart Van Assche <bvanassche@google.com>
This commit is contained in:
@@ -3814,7 +3814,7 @@ static int init_blkz_info(struct f2fs_sb_info *sbi, int devi)
|
||||
sbi->blocks_per_blkz = SECTOR_TO_BLOCK(zone_sectors);
|
||||
FDEV(devi).nr_blkz = div_u64(SECTOR_TO_BLOCK(nr_sectors),
|
||||
sbi->blocks_per_blkz);
|
||||
if (nr_sectors & (zone_sectors - 1))
|
||||
if (!bdev_is_zone_start(bdev, nr_sectors))
|
||||
FDEV(devi).nr_blkz++;
|
||||
|
||||
FDEV(devi).blkz_seq = f2fs_kvzalloc(sbi,
|
||||
|
||||
Reference in New Issue
Block a user