summaryrefslogtreecommitdiffstats
path: root/fs/proc_namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/proc_namespace.c')
-rw-r--r--fs/proc_namespace.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c
index 439406e081af..73ca1740d839 100644
--- a/fs/proc_namespace.c
+++ b/fs/proc_namespace.c
@@ -232,22 +232,15 @@ static int mounts_open_common(struct inode *inode, struct file *file,
if (!task)
goto err;
- rcu_read_lock();
- nsp = task_nsproxy(task);
- if (!nsp) {
- rcu_read_unlock();
+ task_lock(task);
+ nsp = task->nsproxy;
+ if (!nsp || !nsp->mnt_ns) {
+ task_unlock(task);
put_task_struct(task);
goto err;
}
ns = nsp->mnt_ns;
- if (!ns) {
- rcu_read_unlock();
- put_task_struct(task);
- goto err;
- }
get_mnt_ns(ns);
- rcu_read_unlock();
- task_lock(task);
if (!task->fs) {
task_unlock(task);
put_task_struct(task);
@@ -272,6 +265,7 @@ static int mounts_open_common(struct inode *inode, struct file *file,
p->root = root;
p->m.poll_event = ns->event;
p->show = show;
+ p->cached_event = ~0ULL;
return 0;
OpenPOWER on IntegriCloud