mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-08 13:55:19 +00:00
block: vhdx: properly account for bytes read and written
The counter value in vhdx_io::{read,write} should've been accumulated over the loop. Fixes: #6897 Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
parent
7c39f37855
commit
a66fef407c
@ -133,7 +133,7 @@ pub fn read(
|
||||
};
|
||||
sector_count -= sector.free_sectors;
|
||||
sector_index += sector.free_sectors;
|
||||
read_count = sector.free_bytes as usize;
|
||||
read_count += sector.free_bytes as usize;
|
||||
};
|
||||
}
|
||||
Ok(read_count)
|
||||
@ -219,7 +219,7 @@ pub fn write(
|
||||
};
|
||||
sector_count -= sector.free_sectors;
|
||||
sector_index += sector.free_sectors;
|
||||
write_count = sector.free_bytes as usize;
|
||||
write_count += sector.free_bytes as usize;
|
||||
};
|
||||
}
|
||||
Ok(write_count)
|
||||
|
Loading…
Reference in New Issue
Block a user