|
|
@@ -0,0 +1,39 @@
|
|
|
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
+From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <[email protected]>
|
|
|
+Date: Fri, 11 Mar 2022 18:21:04 +0100
|
|
|
+Subject: [PATCH] headers: fix lockdep_assert_not_held()
|
|
|
+MIME-Version: 1.0
|
|
|
+Content-Type: text/plain; charset=UTF-8
|
|
|
+Content-Transfer-Encoding: 8bit
|
|
|
+
|
|
|
+LOCK_STATE_HELD define was omitted during backport of
|
|
|
+lockdep_assert_not_held() which leads to build failures of kernels with
|
|
|
+CONFIG_LOCKDEP=y:
|
|
|
+
|
|
|
+ backports-5.15.8-1/backport-include/linux/lockdep.h:16:47: error: 'LOCK_STATE_HELD' undeclared (first use in this function)
|
|
|
+
|
|
|
+Fix it by adding missing LOCK_STATE_HELD define.
|
|
|
+
|
|
|
+References: https://github.com/openwrt/openwrt/pull/9373
|
|
|
+References: https://lore.kernel.org/backports/[email protected]/T/#u
|
|
|
+Fixes: af58b27b1b1a ("headers: Add lockdep_assert_not_held()")
|
|
|
+Reported-by: Oskari Rauta <[email protected]>
|
|
|
+Signed-off-by: Petr Štetiar <[email protected]>
|
|
|
+---
|
|
|
+ backport-include/linux/lockdep.h | 3 +++
|
|
|
+ 1 file changed, 3 insertions(+)
|
|
|
+
|
|
|
+diff --git a/backport-include/linux/lockdep.h b/backport-include/linux/lockdep.h
|
|
|
+index ed5ea67894e4..842e24b7ff8f 100644
|
|
|
+--- a/backport-include/linux/lockdep.h
|
|
|
++++ b/backport-include/linux/lockdep.h
|
|
|
+@@ -11,6 +11,9 @@ struct lockdep_map { };
|
|
|
+
|
|
|
+ #ifndef lockdep_assert_not_held
|
|
|
+ #ifdef CONFIG_LOCKDEP
|
|
|
++#ifndef LOCK_STATE_HELD
|
|
|
++#define LOCK_STATE_HELD 1
|
|
|
++#endif /* LOCK_STATE_HELD */
|
|
|
+ #define lockdep_assert_not_held(l) do { \
|
|
|
+ WARN_ON(debug_locks && \
|
|
|
+ lockdep_is_held(l) == LOCK_STATE_HELD); \
|