From 68feea7cbe8aca3d439a050c8c29245e07b32741 Mon Sep 17 00:00:00 2001 From: Dylan Reid Date: Fri, 24 Apr 2026 17:09:06 -0700 Subject: [PATCH] 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 (cherry picked from commit fa8acbd712ebf6574938191aaf846001e3be8d1e) --- virtio-devices/src/block.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/virtio-devices/src/block.rs b/virtio-devices/src/block.rs index 524af407e..8ada18fc1 100644 --- a/virtio-devices/src/block.rs +++ b/virtio-devices/src/block.rs @@ -346,8 +346,11 @@ Setting device status to 'NEEDS_RESET' and stopping processing queues until rese ) } } + 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 { let status = match result { Ok(_) => VIRTIO_BLK_S_OK,