[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 01/20] block/block-copy: block_copy_dirty_clusters: fix failur
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH v2 01/20] block/block-copy: block_copy_dirty_clusters: fix failure check |
Date: |
Mon, 1 Jun 2020 21:10:59 +0300 |
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>
---
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.21.0
- [PATCH v2 00/20] backup performance: block_status + async, Vladimir Sementsov-Ogievskiy, 2020/06/01
- [PATCH v2 01/20] block/block-copy: block_copy_dirty_clusters: fix failure check,
Vladimir Sementsov-Ogievskiy <=
- [PATCH v2 02/20] iotests: 129 don't check backup "busy", Vladimir Sementsov-Ogievskiy, 2020/06/01
- [PATCH v2 04/20] block/block-copy: More explicit call_state, Vladimir Sementsov-Ogievskiy, 2020/06/01
- [PATCH v2 03/20] qapi: backup: add x-use-copy-range parameter, Vladimir Sementsov-Ogievskiy, 2020/06/01
- [PATCH v2 05/20] block/block-copy: implement block_copy_async, Vladimir Sementsov-Ogievskiy, 2020/06/01
- [PATCH v2 06/20] block/block-copy: add max_chunk and max_workers parameters, Vladimir Sementsov-Ogievskiy, 2020/06/01
- [PATCH v2 07/20] block/block-copy: add ratelimit to block-copy, Vladimir Sementsov-Ogievskiy, 2020/06/01
- [PATCH v2 08/20] block/block-copy: add block_copy_cancel, Vladimir Sementsov-Ogievskiy, 2020/06/01
- [PATCH v2 09/20] blockjob: add set_speed to BlockJobDriver, Vladimir Sementsov-Ogievskiy, 2020/06/01
- [PATCH v2 10/20] job: call job_enter from job_user_pause, Vladimir Sementsov-Ogievskiy, 2020/06/01
- [PATCH v2 12/20] iotests: 56: prepare for backup over block-copy, Vladimir Sementsov-Ogievskiy, 2020/06/01