Re: [PATCH v3 02/12] block/bdev: Annotate the blk_holder_ops callback invocations

Marco Elver
2026-04-09T13:27:58Z

On Thu, 9 Apr 2026 at 08:42, Christoph Hellwig <hch@lst.de> wrote:
> On Thu, Apr 02, 2026 at 11:39:34AM -0700, Bart Van Assche wrote:
> > The four callback functions in blk_holder_ops all release the
> > bd_holder_lock. Add __release() annotations where appropriate to prepare
> > for enabling thread-safety analysis. Explicit __release() annotations have
> > been added since Clang does not support adding a __releases() annotation
> > to a function pointer.
>
> I have to say I still hate this with passion. If we can't propagate
> the lock context over function pointers it isn't ready for prime time
> unfortunately, as much as I'm looking forward to it.

Let's see if we can land this: https://github.com/llvm/llvm-project/pull/191187

I think we'll be bumping min Clang version to 23 for context analysis,
so hopefully it'll be included in Clang 23 and should solve the
function pointer false positives.