]> git.baikalelectronics.ru Git - kernel.git/commit
blk-mq: call commit_rqs while list empty but error happen
authoryangerkun <yangerkun@huawei.com>
Sat, 5 Sep 2020 11:25:56 +0000 (19:25 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 29 Sep 2020 14:10:17 +0000 (08:10 -0600)
commitab372b84a3a57bc4ad241e22bc7ff8b298b6f7c2
tree82a008b131427f22482b359a62434ebc77f8421d
parent66ccef8d607d57872cc3ad9b4106566d81686983
blk-mq: call commit_rqs while list empty but error happen

Blk-mq should call commit_rqs once 'bd.last != true' and no more
request will come(so virtscsi can kick the virtqueue, e.g.). We already
do that in 'blk_mq_dispatch_rq_list/blk_mq_try_issue_list_directly' while
list not empty and 'queued > 0'. However, we can seen the same scene
once the last request in list call queue_rq and return error like
BLK_STS_IOERR which will not requeue the request, and lead that list
empty but need call commit_rqs too(Or the request for virtscsi will stay
timeout until other request kick virtqueue).

We found this problem by do fsstress test with offline/online virtscsi
device repeat quickly.

Fixes: dd1a96853794 ("blk-mq: add mq_ops->commit_rqs()")
Reported-by: zhangyi (F) <yi.zhang@huawei.com>
Signed-off-by: yangerkun <yangerkun@huawei.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c