Skip to contentSkip to conversation

blk-mq: remove WARN_ON(!q->elevator) from blk_mq_sched_free_requests

PATCH Applied Ming Lei 2 participants 2 messages Jun 11, 2019 – Jun 13, 2019 Block layer

lore
Share & tools
lore

Ming Lei

author
#0 lore raw

PATCH 1/1 blk-mq: remove WARN_ON(!q->elevator) from blk_mq_sched_free_requests

blk_mq_sched_free_requests() may be called in failure path in which q->elevator may not be setup yet, so remove WARN_ON(!q->elevator) from blk_mq_sched_free_requests for avoiding the false positive.

This function is actually safe to call in case of !q->elevator because hctx->sched_tags is checked.

Cc Bart Van Assche <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Yi Zhang <[email protected]>
Fixes c3e2219216c9 ("block: free sched's request pool in blk_cleanup_queue")
Reported-by [email protected]
---
 block/blk-mq-sched.c | 1 -
 1 file changed, 1 deletion(-)
block/blk-mq-sched.c +0 -1
index 500cb04901cc..2766066a15db 100644
@@ -555,7 +555,6 @@ void blk_mq_sched_free_requests(struct request_queue *q)
 	int i;
 
 	lockdep_assert_held(&q->sysfs_lock);
-	WARN_ON(!q->elevator);
 
 	queue_for_each_hw_ctx(q, hctx, i) {
 		if (hctx->sched_tags)
Signature · 1 line
2.20.1
maintainer Applied
#1 lore raw
Quoted 6 lines · Ming Lei

blk_mq_sched_free_requests() may be called in failure path in which q->elevator may not be setup yet, so remove WARN_ON(!q->elevator) from blk_mq_sched_free_requests for avoiding the false positive.

This function is actually safe to call in case of !q->elevator because hctx->sched_tags is checked.

Applied, thanks Ming.

Signature · 1 line
Jens Axboe