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:
Dylan Reid
2026-04-24 17:09:06 -07:00
committed by Bo Chen
parent 544fa4aa76
commit fa8acbd712

View File

@@ -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 {
let status = match result {
Ok(_) => VIRTIO_BLK_S_OK,