qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 5/5] block/block-copy: use aio-task-pool API


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH v4 5/5] block/block-copy: use aio-task-pool API
Date: Thu, 7 May 2020 21:38:39 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1

07.05.2020 18:53, Kevin Wolf wrote:
Am 29.04.2020 um 15:08 hat Vladimir Sementsov-Ogievskiy geschrieben:
Run block_copy iterations in parallel in aio tasks.

Changes:
   - BlockCopyTask becomes aio task structure. Add zeroes field to pass
     it to block_copy_do_copy
   - add call state - it's a state of one call of block_copy(), shared
     between parallel tasks. For now used only to keep information about
     first error: is it read or not.
   - convert block_copy_dirty_clusters to aio-task loop.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>

@@ -519,6 +591,7 @@ static int coroutine_fn 
block_copy_dirty_clusters(BlockCopyState *s,
          }
          if (s->skip_unallocated && !(ret & BDRV_BLOCK_ALLOCATED)) {
              block_copy_task_end(task, 0);
+            g_free(task);
              progress_set_remaining(s->progress,
                                     bdrv_get_dirty_count(s->copy_bitmap) +
                                     s->in_flight_bytes);
              trace_block_copy_skip_range(s, task->offset, task->bytes);
              offset = task_end(task);
              bytes = end - offset;

Coverity found this use after free for task. Please fix.


Oops. Done. Sorry for that :(


--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]