qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: den@openvz.org, qemu-devel@nongnu.org, qemu-block@nongnu.org,
	mreitz@redhat.com
Subject: Re: [PATCH v4 5/5] block/block-copy: use aio-task-pool API
Date: Thu, 7 May 2020 17:53:00 +0200	[thread overview]
Message-ID: <20200507155300.GG6019@linux.fritz.box> (raw)
In-Reply-To: <20200429130847.28124-6-vsementsov@virtuozzo.com>

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 <vsementsov@virtuozzo.com>

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

Kevin



  reply	other threads:[~2020-05-07 15:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 13:08 [PATCH v4 0/5] block-copy: use aio-task-pool Vladimir Sementsov-Ogievskiy
2020-04-29 13:08 ` [PATCH v4 1/5] block/block-copy: rename in-flight requests to tasks Vladimir Sementsov-Ogievskiy
2020-04-29 13:08 ` [PATCH v4 2/5] block/block-copy: alloc task on each iteration Vladimir Sementsov-Ogievskiy
2020-04-29 13:08 ` [PATCH v4 3/5] block/block-copy: add state pointer to BlockCopyTask Vladimir Sementsov-Ogievskiy
2020-04-29 13:08 ` [PATCH v4 4/5] block/block-copy: refactor task creation Vladimir Sementsov-Ogievskiy
2020-04-29 13:08 ` [PATCH v4 5/5] block/block-copy: use aio-task-pool API Vladimir Sementsov-Ogievskiy
2020-05-07 15:53   ` Kevin Wolf [this message]
2020-05-07 18:38     ` Vladimir Sementsov-Ogievskiy
2020-05-05 11:06 ` [PATCH v4 0/5] block-copy: use aio-task-pool Max Reitz
2020-05-06  5:56   ` Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200507155300.GG6019@linux.fritz.box \
    --to=kwolf@redhat.com \
    --cc=den@openvz.org \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).