]> www.infradead.org Git - users/dwmw2/qemu.git/commit
qcow2: Flush pending discards before allocating cluster
authorKevin Wolf <kwolf@redhat.com>
Wed, 6 May 2015 11:21:51 +0000 (13:21 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 28 Jul 2015 23:19:33 +0000 (18:19 -0500)
commitad9c167fd21b488c1c8cfda77e8542a97aefc14f
tree61fe4f36965f6cc51ac7ceb5d656141f15e106db
parentd8e231fce23d49e2f15f2d098463ec110c6eaa56
qcow2: Flush pending discards before allocating cluster

Before a freed cluster can be reused, pending discards for this cluster
must be processed.

The original assumption was that this was not a problem because discards
are only cached during discard/write zeroes operations, which are
synchronous so that no concurrent write requests can cause cluster
allocations.

However, the discard/write zeroes operation itself can allocate a new L2
table (and it has to in order to put zero flags there), so make sure we
can cope with the situation.

This fixes https://bugs.launchpad.net/bugs/1349972.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit ecbda7a22576591a84f44de1be0150faf6001f1c)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2-refcount.c