Message ID | 1433215322-23529-4-git-send-email-famz@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/blockdev.c b/blockdev.c index 5eaf77e..fdc5a17 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1356,6 +1356,7 @@ static void internal_snapshot_prepare(BlkTransactionState *common, } /* 4. succeed, mark a snapshot is created */ + bdrv_lock(bs); state->bs = bs; } @@ -1387,6 +1388,9 @@ static void internal_snapshot_clean(BlkTransactionState *common) InternalSnapshotState *state = DO_UPCAST(InternalSnapshotState, common, common); + if (state->bs) { + bdrv_unlock(state->bs); + } if (state->aio_context) { aio_context_release(state->aio_context); }
Signed-off-by: Fam Zheng <famz@redhat.com> --- blockdev.c | 4 ++++ 1 file changed, 4 insertions(+)