From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH for-2.6] block: Don't ignore flags in blk_aio_write_zeroes()
Date: Fri, 15 Apr 2016 07:59:43 -0600 [thread overview]
Message-ID: <5710F3CF.70402@redhat.com> (raw)
In-Reply-To: <1460708832-8819-1-git-send-email-kwolf@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]
On 04/15/2016 02:27 AM, Kevin Wolf wrote:
> Commit 57d6a428 neglected to pass the given flags to blk_aio_prwv(),
> which broke discard by WRITE SAME for scsi-disk (the UNMAP bit would be
> ignored).
>
> Reported-by: Max Reitz <mreitz@redhat.com>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/block-backend.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/block/block-backend.c b/block/block-backend.c
> index 140c3f7..83cec29 100644
> --- a/block/block-backend.c
> +++ b/block/block-backend.c
> @@ -942,7 +942,8 @@ BlockAIOCB *blk_aio_write_zeroes(BlockBackend *blk, int64_t sector_num,
>
> return blk_aio_prwv(blk, sector_num << BDRV_SECTOR_BITS,
> nb_sectors << BDRV_SECTOR_BITS, NULL,
> - blk_aio_write_entry, BDRV_REQ_ZERO_WRITE, cb, opaque);
> + blk_aio_write_entry, flags | BDRV_REQ_ZERO_WRITE,
> + cb, opaque);
> }
>
Don't you also want:
diff --git i/block/block-backend.c w/block/block-backend.c
index 140c3f7..c99f4ee 100644
--- i/block/block-backend.c
+++ w/block/block-backend.c
@@ -820,7 +820,7 @@ int blk_write_zeroes(BlockBackend *blk, int64_t
sector_num,
int nb_sectors, BdrvRequestFlags flags)
{
return blk_rw(blk, sector_num, NULL, nb_sectors, blk_write_entry,
- BDRV_REQ_ZERO_WRITE);
+ flags | BDRV_REQ_ZERO_WRITE);
}
static void error_callback_bh(void *opaque)
--
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 --]
next prev parent reply other threads:[~2016-04-15 13:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-15 8:27 [Qemu-devel] [PATCH for-2.6] block: Don't ignore flags in blk_aio_write_zeroes() Kevin Wolf
2016-04-15 13:59 ` Eric Blake [this message]
2016-04-15 14:50 ` Kevin Wolf
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=5710F3CF.70402@redhat.com \
--to=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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.