[patch 8/9] Documentation: Fix invalid rcu assumptions

Thomas Gleixner
2009-12-10T00:55:39Z

[-- Attachment #1: documentation-fix-rcu-assumptions.patch --]
[-- Type: text/plain, Size: 1758 bytes --]

1) spinlock held is not equivalent to rcu_read_lock()

2) remove the stale signal code snippet

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Vegard Nossum <vegardno@ifi.uio.no>
Cc: James Morris <jmorris@namei.org>
---
Documentation/credentials.txt | 3 ---
Documentation/kmemcheck.txt | 3 +--
2 files changed, 1 insertion(+), 5 deletions(-)

Index: linux-2.6-tip/Documentation/credentials.txt
===================================================================
--- linux-2.6-tip.orig/Documentation/credentials.txt
+++ linux-2.6-tip/Documentation/credentials.txt
@@ -408,9 +408,6 @@ This should be used inside the RCU read
...
}

-A function need not get RCU read lock to use __task_cred() if it is holding a
-spinlock at the time as this implicitly holds the RCU read lock.
-
Should it be necessary to hold another task's credentials for a long period of
time, and possibly to sleep whilst doing so, then the caller should get a
reference on them using:
Index: linux-2.6-tip/Documentation/kmemcheck.txt
===================================================================
--- linux-2.6-tip.orig/Documentation/kmemcheck.txt
+++ linux-2.6-tip/Documentation/kmemcheck.txt
@@ -429,8 +429,7 @@ Let's take a look at it:
193 /*
194 * We won't get problems with the target's UID changing under us
195 * because changing it requires RCU be used, and if t != current, the
-196 * caller must be holding the RCU readlock (by way of a spinlock) and
-197 * we use RCU protection here
+196 * caller must be holding the RCU readlocke
198 */
199 user = get_uid(__task_cred(t)->user);
200 atomic_inc(&user->sigpending);