aboutsummaryrefslogtreecommitdiffstats
path: root/fs/sysfs/mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/sysfs/mount.c')
-rw-r--r--fs/sysfs/mount.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index a66ad6196f59..8a49486bf30c 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -13,6 +13,7 @@
13#define DEBUG 13#define DEBUG
14 14
15#include <linux/fs.h> 15#include <linux/fs.h>
16#include <linux/magic.h>
16#include <linux/mount.h> 17#include <linux/mount.h>
17#include <linux/init.h> 18#include <linux/init.h>
18#include <linux/user_namespace.h> 19#include <linux/user_namespace.h>
@@ -38,7 +39,8 @@ static struct dentry *sysfs_mount(struct file_system_type *fs_type,
38 } 39 }
39 40
40 ns = kobj_ns_grab_current(KOBJ_NS_TYPE_NET); 41 ns = kobj_ns_grab_current(KOBJ_NS_TYPE_NET);
41 root = kernfs_mount_ns(fs_type, flags, sysfs_root, &new_sb, ns); 42 root = kernfs_mount_ns(fs_type, flags, sysfs_root,
43 SYSFS_MAGIC, &new_sb, ns);
42 if (IS_ERR(root) || !new_sb) 44 if (IS_ERR(root) || !new_sb)
43 kobj_ns_drop(KOBJ_NS_TYPE_NET, ns); 45 kobj_ns_drop(KOBJ_NS_TYPE_NET, ns);
44 return root; 46 return root;
@@ -63,7 +65,8 @@ int __init sysfs_init(void)
63{ 65{
64 int err; 66 int err;
65 67
66 sysfs_root = kernfs_create_root(NULL, 0, NULL); 68 sysfs_root = kernfs_create_root(NULL, KERNFS_ROOT_EXTRA_OPEN_PERM_CHECK,
69 NULL);
67 if (IS_ERR(sysfs_root)) 70 if (IS_ERR(sysfs_root))
68 return PTR_ERR(sysfs_root); 71 return PTR_ERR(sysfs_root);
69 72