Fix VDI reads across allocation blocks - #89
Conversation
|
@Tivian thank you for your contribution! As this is your first code contribution, please read the following Contributor License Agreement (CLA). If you agree with the CLA, please reply with the following information:
Contributor License Agreement
Contribution License AgreementThis Contribution License Agreement ("Agreement") governs your Contribution(s) (as defined below) and conveys certain license rights to Fox-IT B.V. ("Fox-IT") for your Contribution(s) to Fox-IT"s open source Dissect project. This Agreement covers any and all Contributions that you ("You" or "Your"), now or in the future, Submit (as defined below) to this project. This Agreement is between Fox-IT B.V. and You and takes effect when you click an “I Accept” button, check box presented with these terms, otherwise accept these terms or, if earlier, when You Submit a Contribution.
|
|
@DissectBot agree |
Fixes multi-block reads in
VDIStream.The existing
read_lencalculation always evaluates to the full remaining length. As a result, a read spanning multiple VDI blocks can continue reading linearly from the physical block selected for the first logical block, instead of consulting the VDI allocation map for each block.Limit each iteration to the remainder of the current VDI block so subsequent blocks are mapped independently.
Adds a regression test using non-contiguous physical block mappings.
Tested with:
py -m tox -e py3— 58 passedpy -m tox -e lint— passed