Skip to content

Commit

Permalink
xfs: Fix 64-bit division on 32-bit in xlog_state_switch_iclogs()
Browse files Browse the repository at this point in the history
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 <geert@linux-m68k.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
  • Loading branch information
Geert Uytterhoeven authored and Darrick J. Wong committed Jun 18, 2021
1 parent a6a65fe commit 18842e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/xfs/xfs_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 18842e0

Please sign in to comment.