[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 10/19] block: Don't ignore flags in blk_{, co, aio}_w
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 10/19] block: Don't ignore flags in blk_{, co, aio}_write_zeroes() |
Date: |
Fri, 15 Apr 2016 19:02:13 +0200 |
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).
Commit fc1453cd introduced the same bug for blk_write_zeroes(). This is
used for 'qemu-img convert' without has_zero_init (e.g. on a block
device) and for preallocation=falloc in parallels.
Commit 8896e088 is the version for blk_co_write_zeroes(). This function
is only used in qemu-io.
Reported-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
block/block-backend.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/block/block-backend.c b/block/block-backend.c
index 140c3f7..16c9d5e 100644
--- a/block/block-backend.c
+++ b/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)
@@ -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);
}
int blk_pread(BlockBackend *blk, int64_t offset, void *buf, int count)
@@ -1452,7 +1453,7 @@ int coroutine_fn blk_co_write_zeroes(BlockBackend *blk,
int64_t sector_num,
return blk_co_pwritev(blk, sector_num << BDRV_SECTOR_BITS,
nb_sectors << BDRV_SECTOR_BITS, NULL,
- BDRV_REQ_ZERO_WRITE);
+ flags | BDRV_REQ_ZERO_WRITE);
}
int blk_write_compressed(BlockBackend *blk, int64_t sector_num,
--
1.8.3.1
- [Qemu-block] [PULL 00/19] Block layer patches for 2.6.0-rc3, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 02/19] block: Fix blk_aio_write_zeroes(), Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 01/19] qemu-io: Support 'aio_write -z', Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 05/19] block/vpc: use current_size field for XenConverter VHD images, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 03/19] block/vpc: set errp in vpc_create, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 06/19] block/vpc: Use the correct max sector count for VHD images, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 04/19] vpc: use current_size field for XenServer VHD images, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 08/19] block/vpc: set errp in vpc_open, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 10/19] block: Don't ignore flags in blk_{, co, aio}_write_zeroes(),
Kevin Wolf <=
- [Qemu-block] [PULL 13/19] qemu-iotests: common.rc: drop unused _do(), Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 07/19] block/vpc: make checks on max table size a bit more lax, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 09/19] block/vpc: update comments to be compliant w/coding guidelines, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 11/19] Fix pflash migration, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 17/19] nbd: Don't fail handshake on NBD_OPT_LIST descriptions, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 16/19] qemu-iotests: 041: More robust assertion on quorum node, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 15/19] qemu-iotests: place valgrind log file in scratch dir, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 12/19] qemu-iotests: drop unused _within_tolerance() filter, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 18/19] nbd: fix assert() on qemu-nbd stop, Kevin Wolf, 2016/04/15
- [Qemu-block] [PULL 19/19] nbd: Don't kill server on client that doesn't request TLS, Kevin Wolf, 2016/04/15