nfsd: nfsd should drop CAP_MKNOD for non-root
[safe/jmp/linux-2.6] / lib / locking-selftest.c
index 5cd05f2..280332c 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/sched.h>
 #include <linux/delay.h>
 #include <linux/module.h>
+#include <linux/lockdep.h>
 #include <linux/spinlock.h>
 #include <linux/kallsyms.h>
 #include <linux/interrupt.h>
@@ -247,7 +248,7 @@ GENERATE_TESTCASE(AA_rsem)
 
 /*
  * Special-case for read-locking, they are
- * allowed to recurse on the same lock instance:
+ * allowed to recurse on the same lock class:
  */
 static void rlock_AA1(void)
 {
@@ -258,7 +259,7 @@ static void rlock_AA1(void)
 static void rlock_AA1B(void)
 {
        RL(X1);
-       RL(X2); // this one should fail
+       RL(X2); // this one should NOT fail
 }
 
 static void rsem_AA1(void)
@@ -889,9 +890,6 @@ GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion_soft)
 #include "locking-selftest-softirq.h"
 // GENERATE_PERMUTATIONS_3_EVENTS(irq_read_recursion2_soft)
 
-#define lockdep_reset()
-#define lockdep_reset_lock(x)
-
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 # define I_SPINLOCK(x) lockdep_reset_lock(&lock_##x.dep_map)
 # define I_RWLOCK(x)   lockdep_reset_lock(&rwlock_##x.dep_map)
@@ -965,7 +963,9 @@ static void dotest(void (*testcase_fn)(void), int expected, int lockclass_mask)
                        printk("failed|");
                } else {
                        unexpected_testcase_failures++;
+
                        printk("FAILED|");
+                       dump_stack();
                }
        } else {
                testcase_successes++;
@@ -1134,7 +1134,7 @@ void locking_selftest(void)
        init_shared_classes();
        debug_locks_silent = !debug_locks_verbose;
 
-       DO_TESTCASE_6("A-A deadlock", AA);
+       DO_TESTCASE_6R("A-A deadlock", AA);
        DO_TESTCASE_6R("A-B-B-A deadlock", ABBA);
        DO_TESTCASE_6R("A-B-B-C-C-A deadlock", ABBCCA);
        DO_TESTCASE_6R("A-B-C-A-B-C deadlock", ABCABC);
@@ -1155,7 +1155,7 @@ void locking_selftest(void)
 
        print_testname("recursive read-lock #2");
        printk("             |");
-       dotest(rlock_AA1B, FAILURE, LOCKTYPE_RWLOCK);
+       dotest(rlock_AA1B, SUCCESS, LOCKTYPE_RWLOCK);
        printk("             |");
        dotest(rsem_AA1B, FAILURE, LOCKTYPE_RWSEM);
        printk("\n");