Skip to content

Commit 4496e1c

Browse files
arndbakpm00
authored andcommitted
crash_dump, nvme: select CONFIGFS_FS as built-in
Configfs can be configured as a loadable module, which causes a link-time failure for dm-crypt crash dump support: crash_dump_dm_crypt.c:(.text+0x3a4): undefined reference to `config_item_init_type_name' aarch64-linux-ld: kernel/crash_dump_dm_crypt.o: in function `configfs_dmcrypt_keys_init': crash_dump_dm_crypt.c:(.init.text+0x90): undefined reference to `config_group_init' aarch64-linux-ld: crash_dump_dm_crypt.c:(.init.text+0xb4): undefined reference to `configfs_register_subsystem' aarch64-linux-ld: crash_dump_dm_crypt.c:(.init.text+0xd8): undefined reference to `configfs_unregister_subsystem' This could be avoided with a dependency on CONFIGFS_FS=y, but the dependency has an additional problem of causing Kconfig dependency loops since most other uses select the symbol. Using a simple 'select CONFIGFS_FS' here in turn fails with CONFIG_DM_CRYPT=m, because that still only causes configfs to be a loadable module. The only version I found that fixes this reliably uses an additional Kconfig symbol to ensure the 'select' actually turns on configfs as builtin, with two additional changes to avoid dependency loops with nvme and sysfs. There is no compile-time dependency between configfs and sysfs, so selecting configfs from a driver with sysfs disabled does not cause link failures, only the default /sys/kernel/config mount point will not be created. Link: https://lkml.kernel.org/r/[email protected] Fixes: 6b23858 ("crash_dump: make dm crypt keys persist for the kdump kernel") Fixes: 1fb4704 ("nvme-loop: add configfs dependency") Signed-off-by: Arnd Bergmann <[email protected]> Cc: Andreas Hindborg <[email protected]> Cc: Breno Leitao <[email protected]> Cc: Chaitanya Kulkarni <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Coiby Xu <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Sagi Grimberg <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent c164679 commit 4496e1c

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

drivers/nvme/target/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
config NVME_TARGET
44
tristate "NVMe Target support"
55
depends on BLOCK
6-
depends on CONFIGFS_FS
6+
select CONFIGFS_FS
77
select NVME_KEYRING if NVME_TARGET_TCP_TLS
88
select KEYS if NVME_TARGET_TCP_TLS
99
select SGL_ALLOC

fs/configfs/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
config CONFIGFS_FS
33
tristate "Userspace-driven configuration filesystem"
4-
select SYSFS
54
help
65
configfs is a RAM-based filesystem that provides the converse
76
of sysfs's functionality. Where sysfs is a filesystem-based

kernel/Kconfig.kexec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,18 @@ config CRASH_DM_CRYPT
120120
depends on KEXEC_FILE
121121
depends on CRASH_DUMP
122122
depends on DM_CRYPT
123-
depends on CONFIGFS_FS
124123
help
125124
With this option enabled, user space can intereact with
126125
/sys/kernel/config/crash_dm_crypt_keys to make the dm crypt keys
127126
persistent for the dump-capture kernel.
128127

128+
config CRASH_DM_CRYPT_CONFIGS
129+
def_tristate CRASH_DM_CRYPT
130+
select CONFIGFS_FS
131+
help
132+
CRASH_DM_CRYPT cannot directly select CONFIGFS_FS, because that
133+
is required to be built-in.
134+
129135
config CRASH_HOTPLUG
130136
bool "Update the crash elfcorehdr on system configuration changes"
131137
default y

0 commit comments

Comments
 (0)