[Devel] [PATCH RH8] xfs: allow to mount XFS in non-init userns

Evgenii Shatokhin eshatokhin at virtuozzo.com
Thu May 20 19:56:00 MSK 2021


From: Konstantin Khorenko <khorenko at virtuozzo.com>

At the moment XFS is not marked as ready to be mounted inside non-init
userns (see xfs_fs_type), while we previously decided to allow using XFS
inside a CT:
  b86b9049ba50 ("xfs: allow to mount xfs fs inside a Container")
  https://jira.sw.ru/browse/PSBM-72401

so let's mark XFS as mount-able inside non-init userns.

Fixes: b86b9049ba50 ("xfs: allow to mount xfs fs inside a Container")
https://jira.sw.ru/browse/PSBM-86369

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>

eshatokhin@:
Used FS_VE_MOUNT as suggested by Pavel Tikhomirov (ptikhomirov@) instead
of FS_USERNS_MOUNT: it is better to allow mounts only from the init
userns of a container rather than from just any userns.

Done in the scope of https://jira.sw.ru/browse/PSBM-127830.
Signed-off-by: Evgenii Shatokhin <eshatokhin at virtuozzo.com>
---
 fs/xfs/xfs_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 482a89720e6d..4841daca2ff2 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1850,7 +1850,7 @@ static struct file_system_type xfs_fs_type = {
 	.name			= "xfs",
 	.mount			= xfs_fs_mount,
 	.kill_sb		= kill_block_super,
-	.fs_flags		= FS_REQUIRES_DEV | FS_VIRTUALIZED,
+	.fs_flags		= FS_REQUIRES_DEV | FS_VIRTUALIZED | FS_VE_MOUNT,
 };
 MODULE_ALIAS_FS("xfs");
 
-- 
2.29.0



More information about the Devel mailing list