[Devel] [PATCH RHEL10 COMMIT] fs/fs_context: build the mount option formatting only with CONFIG_VE

Konstantin Khorenko khorenko at virtuozzo.com
Fri Aug 21 19:42:26 MSK 2026


The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git
after rh10-6.12.0-211.39.1.16.6.vz10
------>
commit ce6d25ec004839d21f02813c000995778b846f57
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Fri Aug 21 18:37:12 2026 +0200

    fs/fs_context: build the mount option formatting only with CONFIG_VE
    
    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 b2bd21a420836..58fe6f0ce8e8c 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


More information about the Devel mailing list