block/block-copy: block_copy_dirty_clusters: fix failure check
PATCH 1/1 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 <[email protected]>
--- block/block-copy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
block/block-copy.c +3 -1
@@ -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);
Signature · 1 line
2.18.0
Max Reitz
AppliedQuoted 8 lines · Vladimir Sementsov-Ogievskiy
ret may be > 0 on success path at this point. Fix assertion, which may crash currently.
Fixes 4ce5dd3e9b5ee0fac18625860eb3727399ee965eSigned-off-by Vladimir Sementsov-Ogievskiy <[email protected]>--- block/block-copy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Thanks, applied to my block branch: