]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
seqlock: Allow KASAN to fail optimizing
authorPeter Zijlstra <peterz@infradead.org>
Tue, 28 Oct 2025 08:56:38 +0000 (09:56 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Tue, 28 Oct 2025 08:58:57 +0000 (09:58 +0100)
Some KASAN builds are failing to properly optimize this code --
luckily we don't care about core quality for KASAN builds, so just
exclude it.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Closes: https://lore.kernel.org/oe-kbuild-all/202510251641.idrNXhv5-lkp@intel.com/
include/linux/seqlock.h

index b7bcc4111e908cb2d404c12a12a01a6cf2f3c38c..a8a8661839b637dfc84ebff49adb5ec163013090 100644 (file)
@@ -1234,11 +1234,14 @@ static inline void __scoped_seqlock_cleanup(struct ss_tmp *sst)
 
 extern void __scoped_seqlock_invalid_target(void);
 
-#if defined(CONFIG_CC_IS_GCC) && CONFIG_GCC_VERSION < 90000
+#if (defined(CONFIG_CC_IS_GCC) && CONFIG_GCC_VERSION < 90000) || defined(CONFIG_KASAN)
 /*
  * For some reason some GCC-8 architectures (nios2, alpha) have trouble
  * determining that the ss_done state is impossible in __scoped_seqlock_next()
  * below.
+ *
+ * Similarly KASAN is known to confuse compilers enough to break this. But we
+ * don't care about code quality for KASAN builds anyway.
  */
 static inline void __scoped_seqlock_bug(void) { }
 #else