[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 01/31] block/block-copy: block_copy_dirty_clusters: fix failure ch
From: |
Max Reitz |
Subject: |
[PULL 01/31] block/block-copy: block_copy_dirty_clusters: fix failure check |
Date: |
Mon, 6 Jul 2020 12:04:02 +0200 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
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>
---
block/block-copy.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/block-copy.c b/block/block-copy.c
index bb8d0569f2..f7428a7c08 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);
--
2.26.2
- [PULL 00/31] Block patches, Max Reitz, 2020/07/06
- [PULL 01/31] block/block-copy: block_copy_dirty_clusters: fix failure check,
Max Reitz <=
- [PULL 02/31] qcow2: Fix preallocation on images with unaligned sizes, Max Reitz, 2020/07/06
- [PULL 03/31] iotests: Make _filter_img_create more active, Max Reitz, 2020/07/06
- [PULL 04/31] iotests: filter few more luks specific create options, Max Reitz, 2020/07/06
- [PULL 05/31] iotests/common.rc: Add _require_working_luks, Max Reitz, 2020/07/06
- [PULL 07/31] iotests.py: Add (verify|has)_working_luks(), Max Reitz, 2020/07/06
- [PULL 06/31] iotests.py: Add qemu_img_pipe_and_status(), Max Reitz, 2020/07/06
- [PULL 08/31] iotests: Check whether luks works, Max Reitz, 2020/07/06
- [PULL 09/31] qcrypto/core: add generic infrastructure for crypto options amendment, Max Reitz, 2020/07/06
- [PULL 10/31] qcrypto/luks: implement encryption key management, Max Reitz, 2020/07/06