[Devel] [PATCH RHEL9 COMMIT] xfs: Allow to mount XFS in non-init userns

Konstantin Khorenko khorenko at virtuozzo.com
Wed Oct 20 11:39:31 MSK 2021


The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.10.12
------>
commit 0c56b63bf369e6fb7bbb903ed8c900ee1ca50a77
Author: Konstantin Khorenko <khorenko at virtuozzo.com>
Date:   Wed Oct 20 11:39:31 2021 +0300

    xfs: Allow to mount XFS in non-init userns
    
    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 <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.
    
    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 <eshatokhin at virtuozzo.com>
    
    (cherry-picked from vz8 commit 7d3dd4eb58f8 ("xfs: Allow to mount XFS in
    non-init userns"))
    
    Signed-off-by: Nikita Yushchenko <nikita.yushchenko 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 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");
 


More information about the Devel mailing list