On 5/26/21 8:01 PM, Bart Van Assche wrote:
Document the locking strategy by adding two lockdep_assert_held()
statements.
Cc: Damien Le Moal <damien.lemoal@xxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: Ming Lei <ming.lei@xxxxxxxxxx>
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
---
block/mq-deadline.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/mq-deadline.c b/block/mq-deadline.c
index 64cabbc157ea..4da0bd3b9827 100644
--- a/block/mq-deadline.c
+++ b/block/mq-deadline.c
@@ -279,6 +279,8 @@ static struct request *__dd_dispatch_request(struct deadline_data *dd)
bool reads, writes;
int data_dir;
+ lockdep_assert_held(&dd->lock);
+
if (!list_empty(&dd->dispatch)) {
rq = list_first_entry(&dd->dispatch, struct request, queuelist);
list_del_init(&rq->queuelist);
@@ -501,6 +503,8 @@ static void dd_insert_request(struct blk_mq_hw_ctx *hctx, struct request *rq,
struct deadline_data *dd = q->elevator->elevator_data;
const int data_dir = rq_data_dir(rq);
+ lockdep_assert_held(&dd->lock);
+
/*
* This may be a requeue of a write request that has locked its
* target zone. If it is the case, this releases the zone lock.
Reviewed-by: Himanshu Madhani <himanshu.madhani@xxxxxxxxxx>
--
Himanshu Madhani Oracle Linux Engineering