lglock: make lg_lock_global() actually lock globally
authorJonathan Corbet <corbet@lwn.net>
Wed, 8 Sep 2010 22:54:54 +0000 (16:54 -0600)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 9 Sep 2010 16:09:43 +0000 (09:09 -0700)
commita73f8844e1fc54c3762555c1cf1f71774142ca91
tree6cf860dead41a30f5fac677f0cd478efad564c8f
parent39aa3cb3e8250db9188a6f1e3fb62ffa1a717678
lglock: make lg_lock_global() actually lock globally

lg_lock_global() currently only acquires spinlocks for online CPUs, but
it's meant to lock all possible CPUs.  Lglock-protected resources may be
associated with removed CPUs - and, indeed, that could happen with the
per-superblock open files lists.

At Nick's suggestion, change for_each_online_cpu() to
for_each_possible_cpu() to protect accesses to those resources.

Cc: Al Viro <viro@ZenIV.linux.org.uk>
Acked-by: Nick Piggin <npiggin@kernel.dk>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/lglock.h