OSDN Git Service

qcow2: Fix qcow2_alloc_cluster_abort() for external data file
authorKevin Wolf <kwolf@redhat.com>
Tue, 11 Feb 2020 09:48:59 +0000 (10:48 +0100)
committerKevin Wolf <kwolf@redhat.com>
Tue, 18 Feb 2020 09:53:56 +0000 (10:53 +0100)
commitc3b6658c1a5a3fb24d6c27b2594cf86146f75b22
tree40a4b799ffa403c07ae3046aabff5c1c86cd5929
parentdea9052ef1ba12c83f17d394c70d7d710ea1dec9
qcow2: Fix qcow2_alloc_cluster_abort() for external data file

For external data file, cluster allocations return an offset in the data
file and are not refcounted. In this case, there is nothing to do for
qcow2_alloc_cluster_abort(). Freeing the same offset in the qcow2 file
is wrong and causes crashes in the better case or image corruption in
the worse case.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200211094900.17315-3-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2-cluster.c