]> git.ipfire.org Git - thirdparty/linux.git/commit
compiler-context-analysis: Remove __assume_ctx_lock from initializers
authorMarco Elver <elver@google.com>
Mon, 19 Jan 2026 09:05:56 +0000 (10:05 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Wed, 28 Jan 2026 19:45:25 +0000 (20:45 +0100)
commitb682b70d016f6aee20d91dcbaa319a932008a83a
treeff33bbdfb99ddde139c1b5bb32b99b662eaa8083
parent41539433b32d71aea9f7ada84dc6a8bd014ca50d
compiler-context-analysis: Remove __assume_ctx_lock from initializers

Remove __assume_ctx_lock() from lock initializers.

Implicitly asserting an active context during initialization caused
false-positive double-lock errors when acquiring a lock immediately after its
initialization. Moving forward, guarded member initialization must either:

1. Use guard(type_init)(&lock) or scoped_guard(type_init, ...).
2. Use context_unsafe() for simple initialization.

Reported-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/all/57062131-e79e-42c2-aa0b-8f931cb8cac2@acm.org/
Link: https://patch.msgid.link/20260119094029.1344361-7-elver@google.com
include/linux/local_lock_internal.h
include/linux/mutex.h
include/linux/rwlock.h
include/linux/rwlock_rt.h
include/linux/rwsem.h
include/linux/seqlock.h
include/linux/spinlock.h
include/linux/spinlock_rt.h
include/linux/ww_mutex.h
lib/test_context-analysis.c