All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: mreitz@redhat.com, kwolf@redhat.com, den@openvz.org,
	vsementsov@virtuozzo.com, pbonzini@redhat.com, eblake@redhat.com,
	armbru@redhat.com, jsnow@redhat.com, famz@redhat.com
Subject: [Qemu-devel] [PATCH v2 1/7] block/dirty-bitmap: add lock to bdrv_enable/disable_dirty_bitmap
Date: Mon, 16 Apr 2018 14:44:08 +0300	[thread overview]
Message-ID: <20180416114414.18406-2-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20180416114414.18406-1-vsementsov@virtuozzo.com>

Functions write to BdrvDirtyBitmap field, so the should take the lock.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
 block/dirty-bitmap.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/block/dirty-bitmap.c b/block/dirty-bitmap.c
index 967159479d..6c00288fd7 100644
--- a/block/dirty-bitmap.c
+++ b/block/dirty-bitmap.c
@@ -445,15 +445,19 @@ void bdrv_remove_persistent_dirty_bitmap(BlockDriverState *bs,
 /* Called with BQL taken.  */
 void bdrv_disable_dirty_bitmap(BdrvDirtyBitmap *bitmap)
 {
+    bdrv_dirty_bitmap_lock(bitmap);
     assert(!bdrv_dirty_bitmap_frozen(bitmap));
     bitmap->disabled = true;
+    bdrv_dirty_bitmap_unlock(bitmap);
 }
 
 /* Called with BQL taken.  */
 void bdrv_enable_dirty_bitmap(BdrvDirtyBitmap *bitmap)
 {
+    bdrv_dirty_bitmap_lock(bitmap);
     assert(!bdrv_dirty_bitmap_frozen(bitmap));
     bitmap->disabled = false;
+    bdrv_dirty_bitmap_unlock(bitmap);
 }
 
 BlockDirtyInfoList *bdrv_query_dirty_bitmaps(BlockDriverState *bs)
-- 
2.11.1

  reply	other threads:[~2018-04-16 11:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-16 11:44 [Qemu-devel] [PATCH v2 for-2.13 0/7] Dirty bitmaps fixing and refactoring Vladimir Sementsov-Ogievskiy
2018-04-16 11:44 ` Vladimir Sementsov-Ogievskiy [this message]
2018-04-19 21:17   ` [Qemu-devel] [PATCH v2 1/7] block/dirty-bitmap: add lock to bdrv_enable/disable_dirty_bitmap John Snow
2018-04-16 11:44 ` [Qemu-devel] [PATCH v2 2/7] dirty-bitmaps: fix comment about dirty_bitmap_mutex Vladimir Sementsov-Ogievskiy
2018-04-19 21:21   ` John Snow
2018-04-16 11:44 ` [Qemu-devel] [PATCH v2 3/7] dirty-bitmap: remove missed bdrv_dirty_bitmap_get_autoload header Vladimir Sementsov-Ogievskiy
2018-04-19 21:22   ` John Snow
2018-04-16 11:44 ` [Qemu-devel] [PATCH v2 4/7] dirty-bitmap: separate unused meta-bitmap related functions Vladimir Sementsov-Ogievskiy
2018-04-19 21:54   ` John Snow
2018-04-20 12:23     ` Vladimir Sementsov-Ogievskiy
2018-04-16 11:44 ` [Qemu-devel] [PATCH v2 5/7] blockdev: refactor block-dirty-bitmap-clear transaction Vladimir Sementsov-Ogievskiy
2018-04-19 22:47   ` John Snow
2018-04-20 12:32     ` Vladimir Sementsov-Ogievskiy
2018-04-19 22:59   ` John Snow
2018-04-16 11:44 ` [Qemu-devel] [PATCH v2 6/7] block/dirty-bitmap: bdrv_clear_dirty_bitmap: drop unused parameter Vladimir Sementsov-Ogievskiy
2018-04-19 22:50   ` John Snow
2018-04-16 11:44 ` [Qemu-devel] [PATCH v2 7/7] blockdev: unify block-dirty-bitmap-clear command and transaction action Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180416114414.18406-2-vsementsov@virtuozzo.com \
    --to=vsementsov@virtuozzo.com \
    --cc=armbru@redhat.com \
    --cc=den@openvz.org \
    --cc=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.