Re: [PATCH v3 14/18] list: Permit context-unguarded access with list_empty_careful()

From: Christoph Hellwig

Date: Thu Jul 09 2026 - 02:30:41 EST


On Mon, Jul 06, 2026 at 07:44:16PM +0530, Nilay Shroff wrote:
> From: Marco Elver <elver@xxxxxxxxxx>
>
> With Context Analysis (viz. Clang's Thread Safety Analysis), list_heads
> that are __guarded_by(..) require holding the appropriate context lock
> when accessing and manipulating them via the list API. Because Clang's
> warning diagnostics do not perform inter-procedural analysis, this is
> enforced by Clang with -Wthread-safety-pointer in the caller at the call
> boundary; a warning is produced when passing a pointer to a guarded
> variable without holding the appropriate context locks:

Same thing here, maybe try to get this to Linus late in the current
window as it's trivial and makes dependency management much easier.

If that doesn't work, move it to the front of the series.