[Devel] [PATCH vz10 26/32] fs/fs_context: build the mount option formatting only with CONFIG_VE
Konstantin Khorenko
khorenko at virtuozzo.com
Fri Aug 21 19:37:12 MSK 2026
vfs_format_sb_flags() and the two helpers it is built on exist to render
the effective superblock flags back into an option string, which the
Container device-mount policy then checks with ve_devmnt_verify(). Their
only caller sits in the CONFIG_VE part of the file while they do not, so
CONFIG_VE=n leaves them unused - an error rather than a warning once
CONFIG_WERROR=y, as x86_64 defconfig has it:
fs/fs_context.c: error: 'vfs_format_sb_flags' defined but not used
[-Werror=unused-function]
Move the whole group under CONFIG_VE, next to its caller.
Fixes: 37940d776226 ("fs: enforce container device-mount policy in the common mount path")
Feature: ve: ve generic structures
https://virtuozzo.atlassian.net/browse/VSTOR-134732
Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
fs/fs_context.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/fs_context.c b/fs/fs_context.c
index b2bd21a42083..58fe6f0ce8e8 100644
--- a/fs/fs_context.c
+++ b/fs/fs_context.c
@@ -81,6 +81,7 @@ static int vfs_parse_sb_flag(struct fs_context *fc, const char *key)
return -ENOPARAM;
}
+#ifdef CONFIG_VE
/*
* Emit option @name into @buff at *@off, prefixed with ',' if the buffer
* already holds text. Advances *@off. Returns 0 or -E2BIG if @buff is full.
@@ -144,6 +145,7 @@ static int vfs_format_sb_flags(char *buff, size_t size, size_t *off,
return 0;
}
+#endif /* CONFIG_VE */
/**
* vfs_parse_fs_param_source - Handle setting "source" via parameter
--
2.47.1
More information about the Devel
mailing list