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

Submitted by Konstantin Khorenko on March 18, 2021, 5:04 p.m.

Details

Message ID 20210318170409.903280-4-khorenko@virtuozzo.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko March 18, 2021, 5:04 p.m.
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@virtuozzo.com>
---
 fs/ext4/super.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch hide | download patch | download mbox

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");