Re: [PATCH] f2fs: introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup

From: Geert Uytterhoeven
Date: Thu Feb 29 2024 - 03:56:24 EST


Hi Chao,

On Wed, Feb 21, 2024 at 10:20 AM Chao Yu <chao@xxxxxxxxxx> wrote:
> Just cleanup, no functional change.
>
> Signed-off-by: Chao Yu <chao@xxxxxxxxxx>

Thanks for your patch, which is now commit 5fa6a97d27842dab ("f2fs:
introduce SEGS_TO_BLKS/BLKS_TO_SEGS for cleanup") in next-20240229.

noreply@xxxxxxxxxxxxxx reports several build failures on m68k.
http://kisskb.ellerman.id.au/kisskb/head/f303a3e2bcfba900efb5aee55236d17030e9f882/

E.g. m68k defconfig + CONFIG_F2FS_FS=y:

m68k-linux-gnu-ld: fs/f2fs/file.o: in function
`has_not_enough_free_secs.constprop.0':
file.c:(.text+0x19ee): undefined reference to `__moddi3'
m68k-linux-gnu-ld: file.c:(.text+0x1a22): undefined reference to `__divdi3'
m68k-linux-gnu-ld: fs/f2fs/file.o: in function `f2fs_ioc_defragment':
file.c:(.text+0x205a): undefined reference to `__divdi3'
m68k-linux-gnu-ld: fs/f2fs/inode.o: in function `f2fs_write_inode':
inode.c:(.text+0x1692): undefined reference to `__moddi3'
m68k-linux-gnu-ld: inode.c:(.text+0x16c0): undefined reference to `__divdi3'
m68k-linux-gnu-ld: fs/f2fs/namei.o: in function `f2fs_is_checkpoint_ready':
namei.c:(.text+0xa64): undefined reference to `__moddi3'
m68k-linux-gnu-ld: namei.c:(.text+0xa98): undefined reference to `__divdi3'
m68k-linux-gnu-ld: fs/f2fs/gc.o: in function
`has_not_enough_free_secs.constprop.0':
gc.c:(.text+0xe28): undefined reference to `__moddi3'
m68k-linux-gnu-ld: gc.c:(.text+0xe5c): undefined reference to `__divdi3'
m68k-linux-gnu-ld: fs/f2fs/gc.o: in function `f2fs_gc':
gc.c:(.text+0x2f2c): undefined reference to `__divdi3'
m68k-linux-gnu-ld: gc.c:(.text+0x2f58): undefined reference to `__divdi3'
m68k-linux-gnu-ld: gc.c:(.text+0x2f66): undefined reference to `__moddi3'
m68k-linux-gnu-ld: gc.c:(.text+0x2f96): undefined reference to `__moddi3'
m68k-linux-gnu-ld: fs/f2fs/data.o: in function
`has_not_enough_free_secs.constprop.0':
data.c:(.text+0xde8): undefined reference to `__moddi3'
m68k-linux-gnu-ld: data.c:(.text+0xe1c): undefined reference to `__divdi3'
m68k-linux-gnu-ld: fs/f2fs/segment.o: in function
`has_not_enough_free_secs.constprop.0':
segment.c:(.text+0x16ee): undefined reference to `__moddi3'
m68k-linux-gnu-ld: segment.c:(.text+0x1722): undefined reference to `__divdi3'
m68k-linux-gnu-ld: fs/f2fs/xattr.o: in function `f2fs_setxattr':
xattr.c:(.text+0xf5e): undefined reference to `__moddi3'
m68k-linux-gnu-ld: xattr.c:(.text+0xf8c): undefined reference to `__divdi3'

Other 32-bit architectures are affected, too, e.g. arm/shmobile_defconfig
+ CONFIG_F2FS_FS=y:

arm-linux-gnueabihf-ld: fs/f2fs/file.o: in function
`has_not_enough_free_secs.constprop.0':
file.c:(.text+0x1d40): undefined reference to `__aeabi_ldivmod'
arm-linux-gnueabihf-ld: file.c:(.text+0x1d5c): undefined reference to
`__aeabi_ldivmod'
arm-linux-gnueabihf-ld: fs/f2fs/file.o: in function `f2fs_defragment_range':
file.c:(.text+0x2018): undefined reference to `__aeabi_ldivmod'
arm-linux-gnueabihf-ld: fs/f2fs/inode.o: in function `f2fs_write_inode':
inode.c:(.text+0x19d4): undefined reference to `__aeabi_ldivmod'
arm-linux-gnueabihf-ld: inode.c:(.text+0x19f0): undefined reference to
`__aeabi_ldivmod'
arm-linux-gnueabihf-ld: fs/f2fs/namei.o:namei.c:(.text+0x12bc): more
undefined references to `__aeabi_ldivmod' follow

Manually reverting 5fa6a97d27842dab fixes the issue.

64-bit divisions (iff needed at all) must not be open-coded, but use
the helpers from <linux/math64.h> instead.

Gr{oetje,eeting}s,

Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68korg

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds