Commit 42c689f6 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Mike Snitzer

dm zoned: Avoid 64-bit division error in dmz_fixup_devices

When building arm32 allyesconfig:

ld.lld: error: undefined symbol: __aeabi_uldivmod
>>> referenced by dm-zoned-target.c
>>>               md/dm-zoned-target.o:(dmz_ctr) in archive drivers/built-in.a

dmz_fixup_devices uses DIV_ROUND_UP with variables of type sector_t. As
such, it should be using DIV_ROUND_UP_SECTOR_T, which handles this
automatically.

Fixes: 70978208ec91 ("dm zoned: metadata version 2")
Signed-off-by: default avatarNathan Chancellor <natechancellor@gmail.com>
Reviewed-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent ac75b09f
......@@ -803,8 +803,9 @@ static int dmz_fixup_devices(struct dm_target *ti)
if (reg_dev) {
reg_dev->zone_nr_sectors = zoned_dev->zone_nr_sectors;
reg_dev->nr_zones = DIV_ROUND_UP(reg_dev->capacity,
reg_dev->zone_nr_sectors);
reg_dev->nr_zones =
DIV_ROUND_UP_SECTOR_T(reg_dev->capacity,
reg_dev->zone_nr_sectors);
zoned_dev->zone_offset = reg_dev->nr_zones;
}
return 0;
......
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