diff options
author | Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> | 2020-05-26 21:13:47 +0300 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2020-07-06 08:33:06 +0200 |
commit | e8de7ba9ea086c427cd36a10bc3506ac20aa4895 (patch) | |
tree | f7a806c22e50f96258e68c191d7c47e5e9bb492d /block | |
parent | eb6490f544388dd24c0d054a96dd304bc7284450 (diff) | |
download | qemu-e8de7ba9ea086c427cd36a10bc3506ac20aa4895.zip qemu-e8de7ba9ea086c427cd36a10bc3506ac20aa4895.tar.gz qemu-e8de7ba9ea086c427cd36a10bc3506ac20aa4895.tar.bz2 |
block/block-copy: block_copy_dirty_clusters: fix failure check
ret may be > 0 on success path at this point. Fix assertion, which may
crash currently.
Fixes: 4ce5dd3e9b5ee0fac18625860eb3727399ee965e
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20200526181347.489557-1-vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/block-copy.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/block/block-copy.c b/block/block-copy.c index bb8d056..f7428a7 100644 --- a/block/block-copy.c +++ b/block/block-copy.c @@ -622,8 +622,10 @@ out: * block_copy_task_run. If it fails, it means some task already failed * for real reason, let's return first failure. * Still, assert that we don't rewrite failure by success. + * + * Note: ret may be positive here because of block-status result. */ - assert(ret == 0 || aio_task_pool_status(aio) < 0); + assert(ret >= 0 || aio_task_pool_status(aio) < 0); ret = aio_task_pool_status(aio); aio_task_pool_free(aio); |