Blame SOURCES/kvm-block-dirty-bitmaps-fix-merge-permissions.patch

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