From: Konstantin Khorenko <khore...@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.

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

Signed-off-by: Konstantin Khorenko <khore...@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.

Cherry-picked from vz7 commit b86b9049ba50 ("xfs: allow to mount xfs fs
inside a Container")

Done in the scope of https://jira.sw.ru/browse/PSBM-127830.
Signed-off-by: Evgenii Shatokhin <eshatok...@virtuozzo.com>

(cherry-picked from vz8 commit 7d3dd4eb58f8 ("xfs: Allow to mount XFS in
non-init userns"))

Signed-off-by: Nikita Yushchenko <nikita.yushche...@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 304875c0d3cc..fd1cd6aacd10 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1888,7 +1888,7 @@ static struct file_system_type xfs_fs_type = {
        .init_fs_context        = xfs_init_fs_context,
        .parameters             = xfs_fs_parameters,
        .kill_sb                = kill_block_super,
-       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | 
FS_VIRTUALIZED,
+       .fs_flags               = FS_REQUIRES_DEV | FS_ALLOW_IDMAP | 
FS_VIRTUALIZED | FS_VE_MOUNT,
 };
 MODULE_ALIAS_FS("xfs");
 
-- 
2.30.2

_______________________________________________
Devel mailing list
Devel@openvz.org
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to