]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
vfs: fix RCU-lockdep false positive due to /proc
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 20 Jul 2010 20:24:34 +0000 (13:24 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 20 Jul 2010 23:25:41 +0000 (16:25 -0700)
commit844b9a8707f1fcf0482e0c52f44a555e799ccda6
treec9c095c123c2988b014e39b461eb04411b3a197d
parent9d51a6b2487724e8713cd2794cf09ffeee5f6932
vfs: fix RCU-lockdep false positive due to /proc

If a single-threaded process does a file-descriptor operation, and some
other process accesses that same file descriptor via /proc, the current
rcu_dereference_check_fdtable() can give a false-positive RCU-lockdep
splat due to the reference count being increased by the /proc access after
the reference-count check in fget_light() but before the check in
rcu_dereference_check_fdtable().

This commit prevents this false positive by checking for a single-threaded
process.  To avoid #include hell, this commit uses the wrapper for
thread_group_empty(current) defined by rcu_my_thread_group_empty()
provided in a separate commit.

Located-by: Miles Lane <miles.lane@gmail.com>
Located-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/fdtable.h