mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
virtio-devices: block: track non-batch inflight reqs immediately
For non-batch backends execute_async submits the kernel I/O inline before returning. An early return while processing before inserting in inflight_requests, meant the request went untracked, the local batch list was never appended to inflight_requests, even though the request is pending in the kernel. To track it, insert into self.inflight_requests as soon as execute_async returns Ok. The completion path's find_inflight_request now matches the orphan and the bounce buffer is freed only after the kernel signals it is done. Signed-off-by: Dylan Reid <dgreid@fb.com>
This commit is contained in:
@@ -326,8 +326,11 @@ impl BlockEpollHandler {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
batch_inflight_requests.push((desc_chain.head_index(), request));
|
||||||
|
} else {
|
||||||
|
self.inflight_requests
|
||||||
|
.push_back((desc_chain.head_index(), request));
|
||||||
}
|
}
|
||||||
batch_inflight_requests.push((desc_chain.head_index(), request));
|
|
||||||
} else {
|
} else {
|
||||||
let status = match result {
|
let status = match result {
|
||||||
Ok(_) => VIRTIO_BLK_S_OK,
|
Ok(_) => VIRTIO_BLK_S_OK,
|
||||||
|
|||||||
Reference in New Issue
Block a user