Skip to content

Commit

Permalink
backup-top: Begin drain earlier
Browse files Browse the repository at this point in the history
When dropping backup-top, we need to drain the node before freeing the
BlockCopyState.  Otherwise, requests may still be in flight and then the
assertion in shres_destroy() will fail.

(This becomes visible in intermittent failure of 056.)

Cc: qemu-stable@nongnu.org
Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 20191219182638.104621-1-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
(cherry picked from commit 503ca12)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
XanClic authored and mdroth committed May 11, 2020
1 parent cbdfd38 commit 2215837
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions block/backup-top.c
Expand Up @@ -257,12 +257,12 @@ void bdrv_backup_top_drop(BlockDriverState *bs)
BDRVBackupTopState *s = bs->opaque;
AioContext *aio_context = bdrv_get_aio_context(bs);

block_copy_state_free(s->bcs);

aio_context_acquire(aio_context);

bdrv_drained_begin(bs);

block_copy_state_free(s->bcs);

s->active = false;
bdrv_child_refresh_perms(bs, bs->backing, &error_abort);
bdrv_replace_node(bs, backing_bs(bs), &error_abort);
Expand Down

0 comments on commit 2215837

Please sign in to comment.