All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: Fix 64-bit division on 32-bit in xlog_state_switch_iclogs()
@ 2021-06-10 11:00 Geert Uytterhoeven
  2021-06-10 22:01 ` Dave Chinner
  0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2021-06-10 11:00 UTC (permalink / raw)
  To: Dave Chinner, Chandan Babu R, Darrick J . Wong,
	Allison Henderson, Christoph Hellwig
  Cc: linux-xfs, linux-next, linux-kernel, Geert Uytterhoeven, noreply

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>
---
Compile-tested only.
---
 fs/xfs/xfs_log.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index 0e563ff8cd3be4aa..0c91da5defee6b9f 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) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-14  8:18 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 11:00 [PATCH] xfs: Fix 64-bit division on 32-bit in xlog_state_switch_iclogs() Geert Uytterhoeven
2021-06-10 22:01 ` Dave Chinner
2021-06-10 22:50   ` Darrick J. Wong
2021-06-11  6:55   ` Geert Uytterhoeven
2021-06-11 22:46     ` Dave Chinner
2021-06-12  8:54       ` Geert Uytterhoeven
2021-06-14  8:18     ` David Laight

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.