[Devel] [PATCH rh8 4/4] ve/fs: Allow to mount ext4 in top CT userns - cleanup

Konstantin Khorenko khorenko at virtuozzo.com
Thu Mar 18 20:04:09 MSK 2021


After commit d5c3320347bb ("fs/ve: add new FS_VE_MOUNT flag to allow mount
in container init userns") it's wise to use FS_VE_MOUNT flag
instead of generic FS_USERNS_MOUNT + additional per-fs check.

This patch does not change the behavior.

To_merge: 078ab00c9fe1 ("ve/fs: Allow to mount ext4 in top CT userns")

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 fs/ext4/super.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 0c7afda8647a..d03b997b77b3 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -6275,8 +6275,6 @@ static int ext4_get_next_id(struct super_block *sb, struct kqid *qid)
 static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,
 		       const char *dev_name, void *data)
 {
-	if (!current_user_ns_initial())
-		return ERR_PTR(-EPERM);
 	return mount_bdev(fs_type, flags, dev_name, data, ext4_fill_super);
 }
 
@@ -6353,7 +6351,7 @@ static struct file_system_type ext4_fs_type = {
 	.mount		= ext4_mount,
 	.kill_sb	= ext4_kill_sb,
 	.fs_flags	= FS_REQUIRES_DEV | FS_VIRTUALIZED |
-			  FS_USERNS_MOUNT,
+			  FS_VE_MOUNT,
 };
 MODULE_ALIAS_FS("ext4");
 
-- 
2.28.0



More information about the Devel mailing list