don't bother with vfsmount_lock in mounts_poll()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 29 Sep 2013 14:59:59 +0000 (10:59 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 25 Oct 2013 03:34:59 +0000 (23:34 -0400)
wake_up_interruptible/poll_wait provide sufficient barriers;
just use ACCESS_ONCE() to fetch ns->event and that's it.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/proc_namespace.c

index 5fe34c355e85e9bb7175cbfb2367e5c49928837a..439406e081af903a298f6305d9e7c1d744b58813 100644 (file)
@@ -20,15 +20,15 @@ static unsigned mounts_poll(struct file *file, poll_table *wait)
        struct proc_mounts *p = proc_mounts(file->private_data);
        struct mnt_namespace *ns = p->ns;
        unsigned res = POLLIN | POLLRDNORM;
+       int event;
 
        poll_wait(file, &p->ns->poll, wait);
 
-       br_read_lock(&vfsmount_lock);
-       if (p->m.poll_event != ns->event) {
-               p->m.poll_event = ns->event;
+       event = ACCESS_ONCE(ns->event);
+       if (p->m.poll_event != event) {
+               p->m.poll_event = event;
                res |= POLLERR | POLLPRI;
        }
-       br_read_unlock(&vfsmount_lock);
 
        return res;
 }