|
|
383d26 |
From c215981d4abf69a7aaac79dbeea3e5c1ad2ac115 Mon Sep 17 00:00:00 2001
|
|
|
383d26 |
From: John Snow <jsnow@redhat.com>
|
|
|
383d26 |
Date: Wed, 6 Feb 2019 22:12:32 +0100
|
|
|
383d26 |
Subject: [PATCH 22/33] block/dirty-bitmaps: fix merge permissions
|
|
|
383d26 |
|
|
|
383d26 |
RH-Author: John Snow <jsnow@redhat.com>
|
|
|
383d26 |
Message-id: <20190206221243.7407-13-jsnow@redhat.com>
|
|
|
383d26 |
Patchwork-id: 84275
|
|
|
383d26 |
O-Subject: [RHEL-7.7 qemu-kvm-rhev PATCH v2 12/23] block/dirty-bitmaps: fix merge permissions
|
|
|
383d26 |
Bugzilla: 1658343
|
|
|
383d26 |
RH-Acked-by: Thomas Huth <thuth@redhat.com>
|
|
|
383d26 |
RH-Acked-by: Laurent Vivier <lvivier@redhat.com>
|
|
|
383d26 |
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
|
|
|
383d26 |
|
|
|
383d26 |
In prior commits that made merge transactionable, we removed the
|
|
|
383d26 |
assertion that merge cannot operate on disabled bitmaps. In addition,
|
|
|
383d26 |
we want to make sure that we are prohibiting merges to "locked" bitmaps.
|
|
|
383d26 |
|
|
|
383d26 |
Use the new user_locked function to check.
|
|
|
383d26 |
|
|
|
383d26 |
Reported-by: Eric Blake <eblake@redhat.com>
|
|
|
383d26 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
383d26 |
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
|
383d26 |
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
|
|
|
383d26 |
Message-id: 20181002230218.13949-3-jsnow@redhat.com
|
|
|
383d26 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
383d26 |
(cherry picked from commit 283d7a04f2addcc51468635300208b60c19a0db3)
|
|
|
383d26 |
Signed-off-by: John Snow <jsnow@redhat.com>
|
|
|
383d26 |
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
|
|
|
383d26 |
---
|
|
|
383d26 |
block/dirty-bitmap.c | 6 +++---
|
|
|
383d26 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
383d26 |
|
|
|
383d26 |
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
|
|
|
383d26 |
index 8cc7b71..8c7dc60 100644
|
|
|
383d26 |
--- a/block/dirty-bitmap.c
|
|
|
383d26 |
+++ b/block/dirty-bitmap.c
|
|
|
383d26 |
@@ -805,9 +805,9 @@ void bdrv_merge_dirty_bitmap(BdrvDirtyBitmap *dest, const BdrvDirtyBitmap *src,
|
|
|
383d26 |
|
|
|
383d26 |
qemu_mutex_lock(dest->mutex);
|
|
|
383d26 |
|
|
|
383d26 |
- if (bdrv_dirty_bitmap_frozen(dest)) {
|
|
|
383d26 |
- error_setg(errp, "Bitmap '%s' is frozen and cannot be modified",
|
|
|
383d26 |
- dest->name);
|
|
|
383d26 |
+ if (bdrv_dirty_bitmap_user_locked(dest)) {
|
|
|
383d26 |
+ error_setg(errp, "Bitmap '%s' is currently in use by another"
|
|
|
383d26 |
+ " operation and cannot be modified", dest->name);
|
|
|
383d26 |
goto out;
|
|
|
383d26 |
}
|
|
|
383d26 |
|
|
|
383d26 |
--
|
|
|
383d26 |
1.8.3.1
|
|
|
383d26 |
|