[Devel] [PATCH RHEL7 COMMIT] fuse: allow to mount fuse filesystems inside CT

Konstantin Khorenko khorenko at virtuozzo.com
Thu Nov 12 01:52:18 PST 2015


The commit is pushed to "branch-rh7-3.10.0-229.7.2.vz7.9.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-229.7.2.vz7.9.9
------>
commit 8d5114f34900fc68c74519392dce9139838c78b1
Author: Andrey Ryabinin <aryabinin at virtuozzo.com>
Date:   Thu Nov 12 13:52:18 2015 +0400

    fuse: allow to mount fuse filesystems inside CT
    
    Currently mounting fuse fs inside CT fails because
    we don't pass (file->f_cred->user_ns != &init_user_ns) check.
    Test file's namespace against VE's init_cred->user_ns instead.
    This allows to use fuse inside containers.
    
    https://jira.sw.ru/browse/PSBM-41075
    
    Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
    Acked-by: Stanislav Kinsbursky <skinsbursky at virtuozzo.com>
---
 fs/fuse/inode.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 4a1b46f..bb010cb 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -20,6 +20,7 @@
 #include <linux/random.h>
 #include <linux/sched.h>
 #include <linux/exportfs.h>
+#include <linux/ve.h>
 
 MODULE_AUTHOR("Miklos Szeredi <miklos at szeredi.hu>");
 MODULE_DESCRIPTION("Filesystem in Userspace");
@@ -1147,7 +1148,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
 		goto err;
 
 	if ((file->f_op != &fuse_dev_operations) ||
-	    (file->f_cred->user_ns != &init_user_ns))
+	    (file->f_cred->user_ns != ve_init_user_ns()))
 		goto err_fput;
 
 	fc = kmalloc(sizeof(*fc), GFP_KERNEL);


More information about the Devel mailing list