[PATCH v2 10/26] block/ioctl: Add lock context annotations

Bart Van Assche
2026-03-25T21:45:57Z

Add a lock context annotation that is required for Clang's thread-safety
analysis.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
block/ioctl.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/block/ioctl.c b/block/ioctl.c
index 0b04661ac809..784f2965f8bd 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -518,6 +518,7 @@ static int blkdev_pr_read_reservation(struct block_device *bdev,

static int blkdev_flushbuf(struct block_device *bdev, unsigned cmd,
unsigned long arg)
+ __cond_acquires(0, bdev->bd_holder_lock)
{
if (!capable(CAP_SYS_ADMIN))
return -EACCES;