Blame SOURCES/kvm-block-dirty-bitmap-add-lock-to-bdrv_enable-disable_d.patch

357786
From d47b51e706c36542cf32e754fe9c539aed237aef Mon Sep 17 00:00:00 2001
357786
From: John Snow <jsnow@redhat.com>
357786
Date: Wed, 18 Jul 2018 22:54:37 +0200
357786
Subject: [PATCH 52/89] block/dirty-bitmap: add lock to
357786
 bdrv_enable/disable_dirty_bitmap
357786
357786
RH-Author: John Snow <jsnow@redhat.com>
357786
Message-id: <20180718225511.14878-2-jsnow@redhat.com>
357786
Patchwork-id: 81426
357786
O-Subject: [RHEL-7.6 qemu-kvm-rhev PATCH 01/35] block/dirty-bitmap: add lock to bdrv_enable/disable_dirty_bitmap
357786
Bugzilla: 1207657
357786
RH-Acked-by: Eric Blake <eblake@redhat.com>
357786
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
357786
RH-Acked-by: Fam Zheng <famz@redhat.com>
357786
357786
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
357786
357786
Add locks and remove comments about BQL accordingly to
357786
dirty_bitmap_mutex definition in block_int.h.
357786
357786
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
357786
Signed-off-by: John Snow <jsnow@redhat.com>
357786
Reviewed-by: Jeff Cody <jcody@redhat.com>
357786
Message-id: 20180606182449.1607-2-jsnow@redhat.com
357786
Signed-off-by: John Snow <jsnow@redhat.com>
357786
(cherry picked from commit 8b1402ce80d74dc02802f101a0f6c340462380d1)
357786
Signed-off-by: John Snow <jsnow@redhat.com>
357786
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
357786
---
357786
 block/dirty-bitmap.c | 6 ++++--
357786
 1 file changed, 4 insertions(+), 2 deletions(-)
357786
357786
diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
357786
index 9671594..5623425 100644
357786
--- a/block/dirty-bitmap.c
357786
+++ b/block/dirty-bitmap.c
357786
@@ -442,18 +442,20 @@ void bdrv_remove_persistent_dirty_bitmap(BlockDriverState *bs,
357786
     }
357786
 }
357786
 
357786
-/* Called with BQL taken.  */
357786
 void bdrv_disable_dirty_bitmap(BdrvDirtyBitmap *bitmap)
357786
 {
357786
+    bdrv_dirty_bitmap_lock(bitmap);
357786
     assert(!bdrv_dirty_bitmap_frozen(bitmap));
357786
     bitmap->disabled = true;
357786
+    bdrv_dirty_bitmap_unlock(bitmap);
357786
 }
357786
 
357786
-/* Called with BQL taken.  */
357786
 void bdrv_enable_dirty_bitmap(BdrvDirtyBitmap *bitmap)
357786
 {
357786
+    bdrv_dirty_bitmap_lock(bitmap);
357786
     assert(!bdrv_dirty_bitmap_frozen(bitmap));
357786
     bitmap->disabled = false;
357786
+    bdrv_dirty_bitmap_unlock(bitmap);
357786
 }
357786
 
357786
 BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs)
357786
-- 
357786
1.8.3.1
357786