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

Submitted by Konstantin Khorenko on March 19, 2021, 10:44 a.m.

Details

Message ID 202103191044.12JAiHXA904352@finist-co8.sw.ru
State New
Series "Series without cover letter"
Headers show

Commit Message

Konstantin Khorenko March 19, 2021, 10:44 a.m.
The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.8
------>
commit 8d7ddfec0ae071b5a573c5386b30238c9fea121b
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Thu Mar 18 18:06:19 2021 +0300

    ve/fs: Allow to mount ext4 in top CT userns - cleanup
    
    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>
    Reviewed-by: Pavel Tikhomirov <ptikhomirov@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");