Skip to content

Commit

Permalink
block: Fix bdrv_all_delete_snapshot() error handling
Browse files Browse the repository at this point in the history
The code to exit the loop after bdrv_snapshot_delete_by_id_or_name()
returned failure was duplicated. The first copy of it was too early so
that the AioContext lock would not be freed. This patch removes it so
that only the second, correct copy remains.

Signed-off-by: Kevin Wolf <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
kevmw committed Jun 8, 2016
1 parent f3c3b87 commit 2a9170b
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions block/snapshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,6 @@ int bdrv_all_delete_snapshot(const char *name, BlockDriverState **first_bad_bs,
if (bdrv_can_snapshot(bs) &&
bdrv_snapshot_find(bs, snapshot, name) >= 0) {
ret = bdrv_snapshot_delete_by_id_or_name(bs, name, err);
if (ret < 0) {
goto fail;
}
}
aio_context_release(ctx);
if (ret < 0) {
Expand Down

0 comments on commit 2a9170b

Please sign in to comment.