From: Geert Uytterhoeven Date: Fri, 18 Jun 2021 15:24:04 +0000 (-0700) Subject: xfs: Fix 64-bit division on 32-bit in xlog_state_switch_iclogs() X-Git-Tag: howlett/maple/20220722_2~2842^2~24 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=18842e0a4f48564bbed541947abd8131fd0e9734;p=users%2Fjedix%2Flinux-maple.git xfs: Fix 64-bit division on 32-bit in xlog_state_switch_iclogs() On 32-bit (e.g. m68k): ERROR: modpost: "__udivdi3" [fs/xfs/xfs.ko] undefined! Fix this by using a uint32_t intermediate, like before. Reported-by: noreply@ellerman.id.au Fixes: 7660a5b48fbef958 ("xfs: log stripe roundoff is a property of the log") Signed-off-by: Geert Uytterhoeven Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 0e563ff8cd3be..0c91da5defee6 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -3143,8 +3143,8 @@ xlog_state_switch_iclogs( /* Round up to next log-sunit */ if (log->l_iclog_roundoff > BBSIZE) { - log->l_curr_block = roundup(log->l_curr_block, - BTOBB(log->l_iclog_roundoff)); + uint32_t sunit_bb = BTOBB(log->l_iclog_roundoff); + log->l_curr_block = roundup(log->l_curr_block, sunit_bb); } if (log->l_curr_block >= log->l_logBBsize) {