Skip to contentSkip to conversation

xfs: add CONFIG_MMU dependency

PATCH In review Arnd Bergmann 3 participants 3 messages Sep 9, 2024 – Sep 10, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: add CONFIG_MMU dependency

From: Arnd Bergmann <[email protected]>

XFS no longer builds on kernels with MMU disabled:

arm-linux-gnueabi-ld: fs/xfs/xfs_file.o: in function `xfs_write_fault.constprop.0':
xfs_file.c:(.text.xfs_write_fault.constprop.0+0xc): undefined reference to `filemap_fsnotify_fault'

It's rather unlikely that anyone is using this combination, so just add a Kconfig dependency.

Fixes 436df5326f57 ("xfs: add pre-content fsnotify hook for write faults")
---
 fs/xfs/Kconfig    | 1 +
 lib/Kconfig.debug | 1 +
 2 files changed, 2 insertions(+)
fs/xfs/Kconfig +1 -0
index fffd6fffdce0..1834932a512d 100644
@@ -2,6 +2,7 @@
 config XFS_FS
 	tristate "XFS filesystem support"
 	depends on BLOCK
+	depends on MMU
 	select EXPORTFS
 	select LIBCRC32C
 	select FS_IOMAP
lib/Kconfig.debug +1 -0
index 7c0546480078..8906e2cd1ed5 100644
@@ -2862,6 +2862,7 @@ config TEST_KMOD
 	depends on NETDEVICES && NET_CORE && INET # for TUN
 	depends on BLOCK
 	depends on PAGE_SIZE_LESS_THAN_256KB # for BTRFS
+	depends on MMU # for XFS_FS
 	select TEST_LKM
 	select XFS_FS
 	select TUN
Signature · 1 line
2.39.2
#1 lore raw
Quoted 4 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

XFS no longer builds on kernels with MMU disabled:

Quoted 8 lines

arm-linux-gnueabi-ld: fs/xfs/xfs_file.o: in function `xfs_write_fault.constprop.0':
xfs_file.c:(.text.xfs_write_fault.constprop.0+0xc): undefined reference to `filemap_fsnotify_fault'

It's rather unlikely that anyone is using this combination, so just add a Kconfig dependency.

Fixes 436df5326f57 ("xfs: add pre-content fsnotify hook for write faults")

Thanks! I've noticed the error from 0-day over the weekend as well. At this point I'd rather handle this in a similar way as e.g. filemap_fault() is handled in NOMMU case. I agree users of XFS (or bcachefs for that matter) with !CONFIG_MMU are unlikely but fsnotify_filemap_fault() can grow more users over time and providing the stub is easy enough. I'll push out fixed version of the patch.

Honza

Quoted 32 lines
---
 fs/xfs/Kconfig    | 1 +
 lib/Kconfig.debug | 1 +
 2 files changed, 2 insertions(+)
fs/xfs/Kconfig +1 -0
index fffd6fffdce0..1834932a512d 100644
@@ -2,6 +2,7 @@
 config XFS_FS
 	tristate "XFS filesystem support"
 	depends on BLOCK
+	depends on MMU
 	select EXPORTFS
 	select LIBCRC32C
 	select FS_IOMAP
lib/Kconfig.debug +1 -0
index 7c0546480078..8906e2cd1ed5 100644
@@ -2862,6 +2862,7 @@ config TEST_KMOD
 	depends on NETDEVICES && NET_CORE && INET # for TUN
 	depends on BLOCK
 	depends on PAGE_SIZE_LESS_THAN_256KB # for BTRFS
+	depends on MMU # for XFS_FS
 	select TEST_LKM
 	select XFS_FS
 	select TUN
Signature · 1 line
2.39.2
Signature · 2 lines
Jan Kara <[email protected]>
SUSE Labs, CR
#2 lore raw
Quoted 6 lines · Jan Kara

Thanks! I've noticed the error from 0-day over the weekend as well. At this point I'd rather handle this in a similar way as e.g. filemap_fault() is handled in NOMMU case. I agree users of XFS (or bcachefs for that matter) with !CONFIG_MMU are unlikely but fsnotify_filemap_fault() can grow more users over time and providing the stub is easy enough. I'll push out fixed version of the patch.

Yes, the stub is the right fix for this.