]> git.ipfire.org Git - thirdparty/qemu.git/commit
qcow2: update_refcount(): Reset old_table_index after qcow2_cache_put()
authorKevin Wolf <kwolf@redhat.com>
Tue, 11 Feb 2020 09:48:58 +0000 (10:48 +0100)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 2 Jun 2020 15:48:35 +0000 (10:48 -0500)
commitf9854de0d815b0c38a16201e9e11ec61ef84fcf9
tree223c82a3716401440db4c519be7b8397c4076eca
parente49ae74a248fb8d4a90b8376ee2188f2b7cc5992
qcow2: update_refcount(): Reset old_table_index after qcow2_cache_put()

In the case that update_refcount() frees a refcount block, it evicts it
from the metadata cache. Before doing so, however, it returns the
currently used refcount block to the cache because it might be the same.
Returning the refcount block early means that we need to reset
old_table_index so that we reload the refcount block in the next
iteration if it is actually still in use.

Fixes: f71c08ea8e60f035485a512fd2af8908567592f0
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200211094900.17315-2-kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit dea9052ef1ba12c83f17d394c70d7d710ea1dec9)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2-refcount.c