[RHEL7,COMMIT] ve/fs/overlay: allow overlayfs to be mounted in non-root userns

Submitted by Konstantin Khorenko on June 28, 2018, 9:40 a.m.

Details

Message ID 201806280940.w5S9eljT019497@finist_ce7.work
State New
Series "ve/fs/autofs: allow to mount autofs inside non-root userns"
Headers show

Commit Message

Konstantin Khorenko June 28, 2018, 9:40 a.m.
The commit is pushed to "branch-rh7-3.10.0-862.3.2.vz7.61.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.3.2.vz7.61.6
------>
commit f58198e6c6fadad75584cee41e1377af5d68b3c3
Author: Konstantin Khorenko <khorenko@virtuozzo.com>
Date:   Thu Jun 28 12:36:15 2018 +0300

    ve/fs/overlay: allow overlayfs to be mounted in non-root userns
    
    We need overlayfs to be mounted inside Container and RHEL7.5 requires a
    special flag to be set on fs which are allowed to be mounted inside
    non-root user namespaces.
    
    Fixes: e381a0e538de ve/fs/overlay: allow overlayfs to be used inside a Container
    https://jira.sw.ru/browse/PSBM-86153
    
    Signed-off-by: Konstantin Khorenko <khorenko@virtuozzo.com>
---
 fs/overlayfs/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index c9ec521bb7e9..61788949f955 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -1260,7 +1260,8 @@  static struct file_system_type ovl_fs_type = {
 	.name		= "overlay",
 	.mount		= ovl_mount,
 	.kill_sb	= kill_anon_super,
-	.fs_flags	= FS_HAS_DOPS_WRAPPER | FS_VIRTUALIZED,
+	.fs_flags	= FS_HAS_DOPS_WRAPPER |
+			  FS_VIRTUALIZED | FS_USERNS_MOUNT,
 };
 MODULE_ALIAS_FS("overlay");