« Previous | Next » 

Revision 78a52ad5

ID78a52ad5acca7053b774fcc80290e7b7e224c80a

Added by Peter Lieven over 10 years ago

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:
Signed-off-by: Peter Lieven <>
Signed-off-by: Kevin Wolf <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences