]> git.proxmox.com Git - qemu.git/commit
qcow2: Fix refcount block allocation during qcow2_alloc_cluster_at()
authorKevin Wolf <kwolf@redhat.com>
Fri, 20 Apr 2012 13:50:39 +0000 (15:50 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 20 Apr 2012 13:56:19 +0000 (15:56 +0200)
commitf24423bd902bce29bc546cf8d030bfa369726ab1
tree9851f46dc38df995818691a47577de4f85237d1b
parent29926112a2fd619abedd8e21002f5d50c476b402
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 <kwolf@redhat.com>
block/qcow2-refcount.c