Re: [PATCH 00/14] Stop lockdep_assert_held*() from assuming lock ownership
From: Bart Van Assche
Date: Wed Nov 11 2026 - 14:34:10 EST
On 11/11/26 3:17 AM, Marco Elver wrote:
I'm still not convinced by 8-14 esp. in light of my below Coccinelle
experiment.
Hi Marco,
Thank you for having shared your Coccinelle script. I think the script
shows that the current implementation of lockdep_assert_held()
suppresses warnings about missing __must_hold() annotations. So I think
that your script confirms what I explained in the cover letter, namely
that lockdep_assert_held() should be split into two macros: one macro
that includes __assume_ctx_lock() and another macro that doesn't.
The end state is still inconsistent: rwsem_assert_held*() and
lockdep_assert_rq_held() still carry __assumes_ctx_lock(). Either
"assert does not assume" is the rule or it is not.
That's the result of an oversight. I will add variants of
rwsem_assert_held*() that do not carry __assume_ctx_lock().
Thanks,
Bart.