mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
block: AlignedOperation owns its bounce buffer via Drop
The bounce buffer for an unaligned descriptor was allocated in execute_async and leaked on error paths, even though, for the sync case the kernel already had a pointer to the buffer. Clean this up by moving ownership of the buffer to the AlignedOperation type. To make it actually safe, stop stashing a guest memory pointer for the duration of the op. Instead, save the guest address and pass guest memory back to the complete function. Signed-off-by: Dylan Reid <dgreid@fb.com>
This commit is contained in:
@@ -456,7 +456,9 @@ impl BlockEpollHandler {
|
||||
|
||||
let mut request = self.find_inflight_request(desc_index)?;
|
||||
|
||||
request.complete_async().map_err(Error::RequestCompleting)?;
|
||||
request
|
||||
.complete_async(&mem)
|
||||
.map_err(Error::RequestCompleting)?;
|
||||
|
||||
let latency = request.start().elapsed().as_micros() as u64;
|
||||
let read_ops_last = self.counters.read_ops.load(Ordering::Relaxed);
|
||||
|
||||
Reference in New Issue
Block a user