Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / fs / proc_namespace.c
index 7be26f03a3f5813ed501bea520e79041af4466f7..73ca1740d839513468ced1b589bf5e469f391689 100644 (file)
@@ -232,17 +232,15 @@ static int mounts_open_common(struct inode *inode, struct file *file,
        if (!task)
                goto err;
 
-       rcu_read_lock();
-       nsp = task_nsproxy(task);
+       task_lock(task);
+       nsp = task->nsproxy;
        if (!nsp || !nsp->mnt_ns) {
-               rcu_read_unlock();
+               task_unlock(task);
                put_task_struct(task);
                goto err;
        }
        ns = nsp->mnt_ns;
        get_mnt_ns(ns);
-       rcu_read_unlock();
-       task_lock(task);
        if (!task->fs) {
                task_unlock(task);
                put_task_struct(task);
@@ -267,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;