[RHEL8,COMMIT] ve/fs/nfs: NFS containerization - allow to mount NFS in CT root userns

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

Details

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

Commit Message

Konstantin Khorenko March 19, 2021, 10:43 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 5c85dc5639298cf8a7b62bbfdb61a9f69e5a759e
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Wed Mar 17 20:06:30 2021 +0300

    ve/fs/nfs: NFS containerization - allow to mount NFS in CT root userns
    
    Note: mounting NFS shares in any other nested userns is still
    prohibited.
    
    Fixes: 25ba8fad0662 ("ve/fs/nfs: NFS containerization")
    https://jira.sw.ru/browse/PSBM-127234
    
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
    Reviewed-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
---
 fs/nfs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 3093cb4dac13..ec023ddea295 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -304,7 +304,7 @@  struct file_system_type nfs_fs_type = {
 	.mount		= nfs_fs_mount,
 	.kill_sb	= nfs_kill_super,
 	.fs_flags	= FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA|
-			  FS_VIRTUALIZED,
+			  FS_VIRTUALIZED|FS_VE_MOUNT,
 };
 MODULE_ALIAS_FS("nfs");
 EXPORT_SYMBOL_GPL(nfs_fs_type);
@@ -344,7 +344,7 @@  struct file_system_type nfs4_fs_type = {
 	.mount		= nfs_fs_mount,
 	.kill_sb	= nfs_kill_super,
 	.fs_flags	= FS_RENAME_DOES_D_MOVE|FS_BINARY_MOUNTDATA|
-			  FS_VIRTUALIZED,
+			  FS_VIRTUALIZED|FS_VE_MOUNT,
 };
 MODULE_ALIAS_FS("nfs4");
 MODULE_ALIAS("nfs4");