diff options
Diffstat (limited to 'fs/proc/root.c')
-rw-r--r-- | fs/proc/root.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/fs/proc/root.c b/fs/proc/root.c index 9889a92d2e01..c6e9fac26bac 100644 --- a/fs/proc/root.c +++ b/fs/proc/root.c | |||
@@ -100,14 +100,13 @@ static struct dentry *proc_mount(struct file_system_type *fs_type, | |||
100 | int err; | 100 | int err; |
101 | struct super_block *sb; | 101 | struct super_block *sb; |
102 | struct pid_namespace *ns; | 102 | struct pid_namespace *ns; |
103 | struct proc_inode *ei; | ||
104 | char *options; | 103 | char *options; |
105 | 104 | ||
106 | if (flags & MS_KERNMOUNT) { | 105 | if (flags & MS_KERNMOUNT) { |
107 | ns = (struct pid_namespace *)data; | 106 | ns = (struct pid_namespace *)data; |
108 | options = NULL; | 107 | options = NULL; |
109 | } else { | 108 | } else { |
110 | ns = current->nsproxy->pid_ns; | 109 | ns = task_active_pid_ns(current); |
111 | options = data; | 110 | options = data; |
112 | } | 111 | } |
113 | 112 | ||
@@ -130,13 +129,6 @@ static struct dentry *proc_mount(struct file_system_type *fs_type, | |||
130 | sb->s_flags |= MS_ACTIVE; | 129 | sb->s_flags |= MS_ACTIVE; |
131 | } | 130 | } |
132 | 131 | ||
133 | ei = PROC_I(sb->s_root->d_inode); | ||
134 | if (!ei->pid) { | ||
135 | rcu_read_lock(); | ||
136 | ei->pid = get_pid(find_pid_ns(1, ns)); | ||
137 | rcu_read_unlock(); | ||
138 | } | ||
139 | |||
140 | return dget(sb->s_root); | 132 | return dget(sb->s_root); |
141 | } | 133 | } |
142 | 134 | ||
@@ -153,6 +145,7 @@ static struct file_system_type proc_fs_type = { | |||
153 | .name = "proc", | 145 | .name = "proc", |
154 | .mount = proc_mount, | 146 | .mount = proc_mount, |
155 | .kill_sb = proc_kill_sb, | 147 | .kill_sb = proc_kill_sb, |
148 | .fs_flags = FS_USERNS_MOUNT, | ||
156 | }; | 149 | }; |
157 | 150 | ||
158 | void __init proc_root_init(void) | 151 | void __init proc_root_init(void) |
@@ -163,12 +156,8 @@ void __init proc_root_init(void) | |||
163 | err = register_filesystem(&proc_fs_type); | 156 | err = register_filesystem(&proc_fs_type); |
164 | if (err) | 157 | if (err) |
165 | return; | 158 | return; |
166 | err = pid_ns_prepare_proc(&init_pid_ns); | ||
167 | if (err) { | ||
168 | unregister_filesystem(&proc_fs_type); | ||
169 | return; | ||
170 | } | ||
171 | 159 | ||
160 | proc_self_init(); | ||
172 | proc_symlink("mounts", NULL, "self/mounts"); | 161 | proc_symlink("mounts", NULL, "self/mounts"); |
173 | 162 | ||
174 | proc_net_init(); | 163 | proc_net_init(); |