qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Lieven <pl@kamp.de>
To: Stefan Hajnoczi <stefanha@gmail.com>, Fam Zheng <famz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	qemu-stable@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-stable] [PATCH 1/2] block: Fix unaligned zero write
Date: Mon, 23 Mar 2015 15:35:42 +0100	[thread overview]
Message-ID: <551024BE.1050506@kamp.de> (raw)
In-Reply-To: <20150323141443.GJ9268@stefanha-thinkpad.redhat.com>

Am 23.03.2015 um 15:14 schrieb Stefan Hajnoczi:
> On Mon, Mar 23, 2015 at 12:46:09PM +0800, Fam Zheng wrote:
>> @@ -3435,6 +3446,10 @@ static int coroutine_fn bdrv_co_do_pwritev(BlockDriverState *bs,
>>           bytes = ROUND_UP(bytes, align);
>>       }
>>   
>> +    if (use_local_qiov) {
>> +        /* Local buffer may have non-zero data. */
>> +        flags &= ~BDRV_REQ_ZERO_WRITE;
>> +    }
>>       ret = bdrv_aligned_pwritev(bs, &req, offset, bytes,
>>                                  use_local_qiov ? &local_qiov : qiov,
>>                                  flags);
>> @@ -3475,14 +3490,32 @@ int coroutine_fn bdrv_co_write_zeroes(BlockDriverState *bs,
>>                                         int64_t sector_num, int nb_sectors,
>>                                         BdrvRequestFlags flags)
>>   {
>> +    int ret;
>> +
>>       trace_bdrv_co_write_zeroes(bs, sector_num, nb_sectors, flags);
>>   
>> -    if (!(bs->open_flags & BDRV_O_UNMAP)) {
>> -        flags &= ~BDRV_REQ_MAY_UNMAP;
>> -    }
> Why is it okay to drop this when the request is aligned?

I also think it is not. This is the only point in the code that clears the
MAY_UNMAP flag when we do not open with discard=on

Peter

  reply	other threads:[~2015-03-23 14:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-23  4:46 [Qemu-devel] [PATCH 0/2] block: Fix unaligned zero write Fam Zheng
2015-03-23  4:46 ` [Qemu-devel] [PATCH 1/2] " Fam Zheng
2015-03-23 14:14   ` Stefan Hajnoczi
2015-03-23 14:35     ` Peter Lieven [this message]
2015-03-24  1:19     ` Fam Zheng
2015-03-23  4:46 ` [Qemu-devel] [PATCH 2/2] qemu-iotests: Test unaligned 4k " Fam Zheng

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=551024BE.1050506@kamp.de \
    --to=pl@kamp.de \
    --cc=famz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@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 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).