linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blk-mq: remove WARN_ON(!q->elevator) from blk_mq_sched_free_requests
@ 2019-06-11  9:31 Ming Lei
  2019-06-13  9:06 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: Ming Lei @ 2019-06-11  9:31 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Ming Lei, Bart Van Assche, Christoph Hellwig,
	Yi Zhang, syzbot+b9d0d56867048c7bcfde

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 <bvanassche@acm.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Yi Zhang <yi.zhang@redhat.com>
Fixes: c3e2219216c9 ("block: free sched's request pool in blk_cleanup_queue")
Reported-by: syzbot+b9d0d56867048c7bcfde@syzkaller.appspotmail.com
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 block/blk-mq-sched.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/blk-mq-sched.c b/block/blk-mq-sched.c
index 500cb04901cc..2766066a15db 100644
--- a/block/blk-mq-sched.c
+++ b/block/blk-mq-sched.c
@@ -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)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] blk-mq: remove WARN_ON(!q->elevator) from blk_mq_sched_free_requests
  2019-06-11  9:31 [PATCH] blk-mq: remove WARN_ON(!q->elevator) from blk_mq_sched_free_requests Ming Lei
@ 2019-06-13  9:06 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2019-06-13  9:06 UTC (permalink / raw)
  To: Ming Lei
  Cc: linux-block, Bart Van Assche, Christoph Hellwig, Yi Zhang,
	syzbot+b9d0d56867048c7bcfde

On 6/11/19 3:31 AM, Ming Lei wrote:
> 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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-13 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11  9:31 [PATCH] blk-mq: remove WARN_ON(!q->elevator) from blk_mq_sched_free_requests Ming Lei
2019-06-13  9:06 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).