summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2024-12-17 13:03:08 -0800
committerJens Axboe <axboe@kernel.dk>2024-12-23 08:17:23 -0700
commitcbac56e5237dbec9ae3d896e71f24e95e06eafa3 (patch)
tree3b42fc135b4f8ef17ce390b85084f562fa72da60
parent48ea518d0072e29a7af304258a4cedb3e7eea308 (diff)
blk-zoned: Document locking assumptions
Document which functions expect that their callers must hold a lock. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20241217210310.645966-3-bvanassche@acm.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-zoned.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 1575b887fa38..954724a2e3c6 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -459,6 +459,8 @@ static inline void disk_put_zone_wplug(struct blk_zone_wplug *zwplug)
static inline bool disk_should_remove_zone_wplug(struct gendisk *disk,
struct blk_zone_wplug *zwplug)
{
+ lockdep_assert_held(&zwplug->lock);
+
/* If the zone write plug was already removed, we are done. */
if (zwplug->flags & BLK_ZONE_WPLUG_UNHASHED)
return false;
@@ -913,6 +915,8 @@ static bool blk_zone_wplug_prepare_bio(struct blk_zone_wplug *zwplug,
{
struct gendisk *disk = bio->bi_bdev->bd_disk;
+ lockdep_assert_held(&zwplug->lock);
+
/*
* If we lost track of the zone write pointer due to a write error,
* the user must either execute a report zones, reset the zone or finish