Skip to content

Commit

Permalink
block/mq-deadline: Add two lockdep_assert_held() statements
Browse files Browse the repository at this point in the history
Document the locking strategy by adding two lockdep_assert_held()
statements.

Reviewed-by: Chaitanya Kulkarni <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Cc: Damien Le Moal <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Ming Lei <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
bvanassche authored and axboe committed Jun 21, 2021
1 parent 46eae2e commit 3bd473f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions block/mq-deadline.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 3bd473f

Please sign in to comment.