All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org, kwolf@redhat.com,
	Fam Zheng <famz@redhat.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 03/17] block: Switch BlockRequest to byte-based
Date: Thu, 14 Jul 2016 06:33:22 -0600	[thread overview]
Message-ID: <57878692.8020101@redhat.com> (raw)
In-Reply-To: <20160714121532.GF15476@stefanha-x1.localdomain>

[-- Attachment #1: Type: text/plain, Size: 1114 bytes --]

On 07/14/2016 06:15 AM, Stefan Hajnoczi wrote:
> On Wed, Jun 22, 2016 at 09:51:00AM -0600, Eric Blake wrote:
>> @@ -2204,14 +2203,15 @@ BlockAIOCB *bdrv_aio_discard(BlockDriverState *bs,
>>  {
>>      Coroutine *co;
>>      BlockAIOCBCoroutine *acb;
>> +    QEMUIOVector qiov = { .size = nb_sectors << BDRV_SECTOR_BITS, };
>>
>>      trace_bdrv_aio_discard(bs, sector_num, nb_sectors, opaque);
>>
>>      acb = qemu_aio_get(&bdrv_em_co_aiocb_info, bs, cb, opaque);
>>      acb->need_bh = true;
>>      acb->req.error = -EINPROGRESS;
>> -    acb->req.sector = sector_num;
>> -    acb->req.nb_sectors = nb_sectors;
>> +    acb->req.offset = sector_num << BDRV_SECTOR_BITS;
>> +    acb->req.qiov = &qiov;
> 
> This looks unsafe: the pointer to a stack-allocated qiov is held after
> the function returns.

Hmm, you're right.  I'll definitely have to rework this one.  But since
the ONLY thing being passed through the qiov was the size, it may be
easiest to just add acb->req.size.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


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

  reply	other threads:[~2016-07-14 12:33 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 15:50 [Qemu-devel] [PATCH 00/17] byte-based block discard Eric Blake
2016-06-22 15:50 ` [Qemu-devel] [PATCH 01/17] block: Convert bdrv_co_discard() to byte-based Eric Blake
2016-07-14 12:15   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-07-15 21:42   ` [Qemu-devel] " Eric Blake
2016-06-22 15:50 ` [Qemu-devel] [PATCH 02/17] block: Convert bdrv_discard() " Eric Blake
2016-07-14 12:15   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 03/17] block: Switch BlockRequest " Eric Blake
2016-07-14 12:15   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-07-14 12:33     ` Eric Blake [this message]
2016-06-22 15:51 ` [Qemu-devel] [PATCH 04/17] block: Convert bdrv_aio_discard() " Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 05/17] block: Convert BB interface to byte-based discards Eric Blake
2016-06-22 15:51   ` Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-07-14 12:16     ` Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 06/17] raw-posix: Switch paio_submit() to byte-based Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 07/17] rbd: Switch rbd_start_aio() " Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 08/17] block: Convert .bdrv_aio_discard() " Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 09/17] block: Add .bdrv_co_pdiscard() driver callback Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 10/17] blkreplay: Switch .bdrv_co_discard() to byte-based Eric Blake
2016-07-14 12:16   ` Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 11/17] gluster: " Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 12/17] iscsi: " Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 13/17] nbd: " Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 14/17] qcow2: " Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 15/17] raw_bsd: " Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 16/17] sheepdog: " Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-06-22 15:51 ` [Qemu-devel] [PATCH 17/17] block: Kill .bdrv_co_discard() Eric Blake
2016-07-14 12:16   ` [Qemu-devel] [Qemu-block] " Stefan Hajnoczi
2016-07-14 12:30 ` [Qemu-devel] [PATCH 00/17] byte-based block discard Eric Blake

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=57878692.8020101@redhat.com \
    --to=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@redhat.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 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.