blockdev: fix bitmap clear undo
PATCH 1/1 blockdev: fix bitmap clear undo
Only undo the action if we actually prepared the action.
Signed-off-by John Snow <[email protected]>
--- blockdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
blockdev.c +3 -1
@@ -2047,7 +2047,9 @@ static void block_dirty_bitmap_clear_abort(BlkActionState *common)BlockDirtyBitmapState *state =DO_UPCAST (BlockDirtyBitmapState, common, common); -bdrv_undo_clear_dirty_bitmap (state->bitmap, state->backup); +if (state->backup) { +bdrv_undo_clear_dirty_bitmap (state->bitmap, state->backup); + } }static void block_dirty_bitmap_clear_commit (BlkActionState *common)
Signature · 1 line
2.9.3
Quoted 6 lines · John Snow
Only undo the action if we actually prepared the action.
Signed-off-by John Snow <[email protected]>--- blockdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Reviewed-by Eric Blake <[email protected]>
Quoted 17 lines
blockdev.c +3
-1@@ -2047,7 +2047,9 @@ static void block_dirty_bitmap_clear_abort(BlkActionState *common)BlockDirtyBitmapState *state =DO_UPCAST (BlockDirtyBitmapState, common, common); -bdrv_undo_clear_dirty_bitmap (state->bitmap, state->backup); +if (state->backup) { +bdrv_undo_clear_dirty_bitmap (state->bitmap, state->backup); + } }static void block_dirty_bitmap_clear_commit (BlkActionState *common)
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
Kevin Wolf
AppliedAm 15.03.2017 um 22:28 hat John Snow geschrieben:
Quoted 3 lines
Only undo the action if we actually prepared the action.
Signed-off-by John Snow <[email protected]>
Thanks, applied to the block branch.
Kevin