All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block/block-copy: block_copy_dirty_clusters: fix failure check
@ 2020-05-26 18:13 Vladimir Sementsov-Ogievskiy
  2020-06-03 14:05 ` Max Reitz
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2020-05-26 18:13 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, vsementsov, qemu-devel, mreitz

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.18.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] block/block-copy: block_copy_dirty_clusters: fix failure check
  2020-05-26 18:13 [PATCH] block/block-copy: block_copy_dirty_clusters: fix failure check Vladimir Sementsov-Ogievskiy
@ 2020-06-03 14:05 ` Max Reitz
  0 siblings, 0 replies; 2+ messages in thread
From: Max Reitz @ 2020-06-03 14:05 UTC (permalink / raw)
  To: Vladimir Sementsov-Ogievskiy, qemu-block; +Cc: kwolf, qemu-devel


[-- Attachment #1.1: Type: text/plain, Size: 471 bytes --]

On 26.05.20 20:13, Vladimir Sementsov-Ogievskiy wrote:
> 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(-)

Thanks, applied to my block branch:

https://git.xanclic.moe/XanClic/qemu/commits/branch/block


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-03 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-26 18:13 [PATCH] block/block-copy: block_copy_dirty_clusters: fix failure check Vladimir Sementsov-Ogievskiy
2020-06-03 14:05 ` Max Reitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.