[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180802174937.15444-3-ming.lei@redhat.com>
Date: Fri, 3 Aug 2018 01:49:37 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: linux-block@...r.kernel.org, Ming Lei <ming.lei@...hat.com>,
Josef Bacik <josef@...icpanda.com>,
Christoph Hellwig <hch@....de>,
Guenter Roeck <linux@...ck-us.net>,
Mark Brown <broonie@...nel.org>,
Matt Hart <matthew.hart@...aro.org>,
Johannes Thumshirn <jthumshirn@...e.de>,
John Garry <john.garry@...wei.com>,
Hannes Reinecke <hare@...e.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
James Bottomley <James.Bottomley@...senpartnership.com>,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH V2 2/2] blk-mq: fix blk_mq_tagset_busy_iter
Commit d250bf4e776ff09d5("blk-mq: only iterate over inflight requests
in blk_mq_tagset_busy_iter") uses 'blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT'
to replace 'blk_mq_request_started(req)', this way is wrong, and causes
lots of test system hang during booting.
Fix the issue by using blk_mq_request_started(req) inside bt_tags_iter().
Fixes: d250bf4e776ff09d5 ("blk-mq: only iterate over inflight requests in blk_mq_tagset_busy_iter")
Cc: Josef Bacik <josef@...icpanda.com>
Cc: Christoph Hellwig <hch@....de>
Cc: Guenter Roeck <linux@...ck-us.net>
Cc: Mark Brown <broonie@...nel.org>
Cc: Matt Hart <matthew.hart@...aro.org>
Cc: Johannes Thumshirn <jthumshirn@...e.de>
Cc: John Garry <john.garry@...wei.com>
Cc: Hannes Reinecke <hare@...e.com>,
Cc: "Martin K. Petersen" <martin.petersen@...cle.com>,
Cc: James Bottomley <James.Bottomley@...senpartnership.com>
Cc: linux-scsi@...r.kernel.org
Cc: linux-kernel@...r.kernel.org
Reported-by: Mark Brown <broonie@...nel.org>
Reported-by: Guenter Roeck <linux@...ck-us.net>
Signed-off-by: Ming Lei <ming.lei@...hat.com>
---
block/blk-mq-tag.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 09b2ee6694fb..3de0836163c2 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -271,7 +271,7 @@ static bool bt_tags_iter(struct sbitmap *bitmap, unsigned int bitnr, void *data)
* test and set the bit before assining ->rqs[].
*/
rq = tags->rqs[bitnr];
- if (rq && blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT)
+ if (rq && blk_mq_request_started(rq))
iter_data->fn(rq, iter_data->data, reserved);
return true;
--
2.9.5
Powered by blists - more mailing lists