« Previous | Next » 

Revision f24423bd

IDf24423bd902bce29bc546cf8d030bfa369726ab1

Added by Kevin Wolf about 12 years ago

qcow2: Fix refcount block allocation during qcow2_alloc_cluster_at()

Refcount block allocation and refcount table growth rely on
s->free_cluster_index pointing to somewhere after the current
allocation. Change qcow2_alloc_cluster_at() to fulfill this
assumption.

Without this change it could happen that a newly allocated refcount
block and the allocated data block point to the same area in the image
file, causing data corruption in the long run.

This fixes a bug that became first visible after commit 250196f1.

Signed-off-by: Kevin Wolf <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences