From: Nathan Chancellor Date: Wed, 13 May 2020 08:45:22 +0000 (-0700) Subject: dm zoned: Avoid 64-bit division error in dmz_fixup_devices X-Git-Tag: Ubuntu-5.13.0-19.19~5858^2~31 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=42c689f671233371f5c8c1685ab77bd66c274932;p=mirror_ubuntu-jammy-kernel.git 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: Nathan Chancellor Reviewed-by: Damien Le Moal Signed-off-by: Mike Snitzer --- diff --git a/drivers/md/dm-zoned-target.c b/drivers/md/dm-zoned-target.c index a3d572da70ad..b586fc67d931 100644 --- a/drivers/md/dm-zoned-target.c +++ b/drivers/md/dm-zoned-target.c @@ -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;