aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2019-12-09 16:06:51 +0000
committerPeter Maydell <peter.maydell@linaro.org>2019-12-09 16:06:51 +0000
commit9b4efa2ede5db24377405a21b218066b90fe2f0e (patch)
treeaa868e8d60cb55d9e571e6884e9fd7ef79bd92b4
parent8350b17be015bb872f28268bdeba1bac6c380efc (diff)
parentf56281abd957561b30538cbe606c3793b9b4c56d (diff)
Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2019-12-09' into staging
bitmap fix for 4.2-rc5 - Fix a regression that broke bitmap deletion without a transaction, and causes a crash with transaction (only transaction is new to 4.2), when a qcow2 file contains persistent bitmaps from prior shutdown # gpg: Signature made Mon 09 Dec 2019 15:28:19 GMT # gpg: using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A # gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full] # gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full] # gpg: aka "[jpeg image of size 6874]" [full] # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A * remotes/ericb/tags/pull-nbd-2019-12-09: block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r--block/qcow2-bitmap.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c
index 8abaf632fc..c6c8ebbe89 100644
--- a/block/qcow2-bitmap.c
+++ b/block/qcow2-bitmap.c
@@ -1469,8 +1469,10 @@ int coroutine_fn qcow2_co_remove_persistent_dirty_bitmap(BlockDriverState *bs,
Qcow2BitmapList *bm_list;
if (s->nb_bitmaps == 0) {
- /* Absence of the bitmap is not an error: see explanation above
- * bdrv_remove_persistent_dirty_bitmap() definition. */
+ /*
+ * Absence of the bitmap is not an error: see explanation above
+ * bdrv_co_remove_persistent_dirty_bitmap() definition.
+ */
return 0;
}
@@ -1485,7 +1487,8 @@ int coroutine_fn qcow2_co_remove_persistent_dirty_bitmap(BlockDriverState *bs,
bm = find_bitmap_by_name(bm_list, name);
if (bm == NULL) {
- ret = -EINVAL;
+ /* Absence of the bitmap is not an error, see above. */
+ ret = 0;
goto out;
}