From 58f72b965e9e1820d246329461216c4d13140122 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Wed, 4 Jul 2018 02:12:49 -0400 Subject: dirty-bitmap: fix double lock on bitmap enabling Bitmap lock/unlock were added to bdrv_enable_dirty_bitmap in 8b1402ce80d, but some places were not updated correspondingly, which leads to trying to take this lock twice, which is dead-lock. Fix this. Actually, iotest 199 (about dirty bitmap postcopy migration) is broken now, and this fixes it. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-id: 20180625165745.25259-3-vsementsov@virtuozzo.com Signed-off-by: John Snow --- block/dirty-bitmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'block') diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c index 93744b3..c9b8a6f 100644 --- a/block/dirty-bitmap.c +++ b/block/dirty-bitmap.c @@ -250,8 +250,9 @@ void bdrv_enable_dirty_bitmap_locked(BdrvDirtyBitmap *bitmap) /* Called with BQL taken. */ void bdrv_dirty_bitmap_enable_successor(BdrvDirtyBitmap *bitmap) { + assert(bitmap->mutex == bitmap->successor->mutex); qemu_mutex_lock(bitmap->mutex); - bdrv_enable_dirty_bitmap(bitmap->successor); + bdrv_enable_dirty_bitmap_locked(bitmap->successor); qemu_mutex_unlock(bitmap->mutex); } -- cgit v1.1