Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qcow2: fix possible corruption when reading multiple clusters
if multiple sectors spanning multiple clusters are read the function count_contiguous_clusters should ensure that the cluster type should not change between the clusters. Especially the for-loop should break when we have one or more normal clusters followed by a compressed cluster. Unfortunately the wrong macro was used in the mask to compare the flags. This was discovered while debugging a data corruption issue when converting a compressed qcow2 image to raw. qemu-img reads 2MB chunks which span multiple clusters. CC: [email protected] Signed-off-by: Peter Lieven <[email protected]> Signed-off-by: Kevin Wolf <[email protected]>
- Loading branch information