Thread (6 messages) 6 messages, 4 authors, 2022-09-22

Re: [PATCH v2] virtio-blk: Fix WARN_ON_ONCE in virtio_queue_rq()

From: Pankaj Raghav <hidden>
Date: 2022-08-31 12:44:54

On Wed, Aug 31, 2022 at 12:01:53AM +0900, Suwan Kim wrote:
If a request fails at virtio_queue_rqs(), it is inserted to requeue_list
and passed to virtio_queue_rq(). Then blk_mq_start_request() can be called
again at virtio_queue_rq() and trigger WARN_ON_ONCE like below trace because
request state was already set to MQ_RQ_IN_FLIGHT in virtio_queue_rqs()
despite the failure.

To avoid calling blk_mq_start_request() twice, This patch moves the
execution of blk_mq_start_request() to the end of virtblk_prep_rq().
And instead of requeuing failed request to plug list in the error path of
virtblk_add_req_batch(), it uses blk_mq_requeue_request() to change failed
request state to MQ_RQ_IDLE. Then virtblk can safely handle the request
on the next trial.

Fixes: 0e9911fa768f ("virtio-blk: support mq_ops->queue_rqs()")
Reported-by: Alexandre Courbot <redacted>
Tested-by: Alexandre Courbot <redacted>
Signed-off-by: Suwan Kim <redacted>
---
Looks good.
Reviewed-by: Pankaj Raghav <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help