diff options
author | Kevin Wolf <kwolf@redhat.com> | 2015-12-16 16:05:21 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-01-20 13:36:23 +0100 |
commit | 23c88b24721ee907639705bf9de03dcd6b1e66ad (patch) | |
tree | 8a5b9ce1e2e1532f589288b231935e772363cb48 /block.c | |
parent | 09e0c771e47e02278c264bafff6bfc0771732d72 (diff) |
block: Fix error path in bdrv_invalidate_cache()
We can only clear BDRV_O_INCOMING if the caches were actually
invalidated.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -3272,12 +3272,14 @@ void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp) bdrv_invalidate_cache(bs->file->bs, &local_err); } if (local_err) { + bs->open_flags |= BDRV_O_INCOMING; error_propagate(errp, local_err); return; } ret = refresh_total_sectors(bs, bs->total_sectors); if (ret < 0) { + bs->open_flags |= BDRV_O_INCOMING; error_setg_errno(errp, -ret, "Could not refresh total sector count"); return; } |