[Devel] [PATCH RH8] ve/fs/autofs: allow autofs to be used inside a container

Pavel Tikhomirov ptikhomirov at virtuozzo.com
Tue Apr 20 14:39:27 MSK 2021


From: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>

It turned out that autofs is used at least for NFS/CIFS and binfmt_misc.

Let's use new FS_VE_MOUNT flag to only allow autofs mounts in
conainer-init userns, which would mimic mainstream host behaviour.

https://jira.sw.ru/browse/PSBM-26968
https://jira.sw.ru/browse/PSBM-86138
https://jira.sw.ru/browse/PSBM-128649

Rebase from VZ7, with use of FS_VE_MOUNT and with comment cleanup:
83c27c7bffcc1 ("ve/fs/autofs: mark autofs as virtualized")

Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
 fs/autofs/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/autofs/init.c b/fs/autofs/init.c
index 99bb56d42907d..e502b0c0d2159 100644
--- a/fs/autofs/init.c
+++ b/fs/autofs/init.c
@@ -21,7 +21,7 @@ struct file_system_type autofs_fs_type = {
 	.name		= "autofs",
 	.mount		= autofs_mount,
 	.kill_sb	= autofs_kill_sb,
-	.fs_flags	= FS_VIRTUALIZED,
+	.fs_flags	= FS_VIRTUALIZED | FS_VE_MOUNT,
 };
 MODULE_ALIAS_FS("autofs");
 MODULE_ALIAS("autofs");
-- 
2.30.2



More information about the Devel mailing list