add patch add-missing-error-check-in-ext4_new_inode
[ext4-patch-queue.git] / add-lockdep-aggressive
blobd8112821575b8417a496fc8a62cc52bfdfdbc0ab
1 locking/lockdep: Add CONFIG_LOCKDEP_AGGRESSIVE
3 CONFIG_LOCKDEP_CROSSRELEASE and CONFIG_LOCKDEP_COMPLETIONS can result
4 in a large number of false positives because lockdep doesn't
5 understand how to deal with multiple stacked loop or MD devices.
7 Until someone can figure out how to automatically add annotations to
8 all file system and storage devices --- hopefully without forcing
9 developers to insert a large number of calls to undocumented lockdep
10 macros into the the loop device, every single file system, and every
11 single device-mapper backend --- let's add an option to allow these
12 lockdep features to be disabled.  Otherwise, many file system
13 developers will disable LOCKDEP entirely since it results in far too
14 many false positives when trying to use xfstests.
16 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
17 Cc: Byungchul Park <byungchul.park@lge.com>
18 Cc: Linus Torvalds <torvalds@linux-foundation.org>
19 Cc: Peter Zijlstra <peterz@infradead.org>
20 Cc: Thomas Gleixner <tglx@linutronix.de>
21 Cc: kernel-team@lge.com
22 Cc: linux-block@vger.kernel.org
23 Cc: linux-fsdevel@vger.kernel.org
24 Cc: oleg@redhat.com
25 Cc: tj@kernel.org
26 ---
27  lib/Kconfig.debug | 14 ++++++++++++--
28  1 file changed, 12 insertions(+), 2 deletions(-)
30 diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
31 index 947d3e2ed5c2..acae7ba99c16 100644
32 --- a/lib/Kconfig.debug
33 +++ b/lib/Kconfig.debug
34 @@ -1099,8 +1099,8 @@ config PROVE_LOCKING
35         select DEBUG_MUTEXES
36         select DEBUG_RT_MUTEXES if RT_MUTEXES
37         select DEBUG_LOCK_ALLOC
38 -       select LOCKDEP_CROSSRELEASE
39 -       select LOCKDEP_COMPLETIONS
40 +       select LOCKDEP_CROSSRELEASE if LOCKDEP_AGGRESSIVE
41 +       select LOCKDEP_COMPLETIONS if LOCKDEP_AGGRESSIVE
42         select TRACE_IRQFLAGS
43         default n
44         help
45 @@ -1137,6 +1137,16 @@ config PROVE_LOCKING
47          For more details, see Documentation/locking/lockdep-design.txt.
49 +config LOCKDEP_AGGRESSIVE
50 +       bool "Lock debugging: use aggressive techniques"
51 +       default n
52 +       help
53 +        This enables some extremely aggressive lockdep checking that
54 +        may result in false positives.
56 +        Say N here if you are planning on using xfstests and don't
57 +        want to deal with many false positive test failures.
59  config LOCKDEP
60         bool
61         depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT