Skip to content
Commit 489e18f3 authored by Suwan Kim's avatar Suwan Kim Committed by Michael S. Tsirkin
Browse files

virtio-blk: set req->state to MQ_RQ_COMPLETE after polling I/O is finished



Driver should set req->state to MQ_RQ_COMPLETE after it finishes to process
req. But virtio-blk doesn't set MQ_RQ_COMPLETE after virtblk_poll() handles
req and req->state still remains MQ_RQ_IN_FLIGHT. Fortunately so far there
is no issue about it because blk_mq_end_request_batch() sets req->state to
MQ_RQ_IDLE.

In this patch, virblk_poll() calls blk_mq_complete_request_remote() to set
req->state to MQ_RQ_COMPLETE before it adds req to a batch completion list.
So it properly sets req->state after polling I/O is finished.

Fixes: 4e040052 ("virtio-blk: support polling I/O")
Signed-off-by: default avatarSuwan Kim <suwan.kim027@gmail.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Message-Id: <20221221145456.281218-2-suwan.kim027@gmail.com>
Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
parent 2b034e82
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment