[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 18/31] block/export: fix blk_size double byteswap
From: |
Kevin Wolf |
Subject: |
[PULL 18/31] block/export: fix blk_size double byteswap |
Date: |
Fri, 5 Mar 2021 17:54:41 +0100 |
From: Stefan Hajnoczi <stefanha@redhat.com>
The config->blk_size field is little-endian. Use the native-endian
blk_size variable to avoid double byteswapping.
Fixes: 11f60f7eaee2630dd6fa0c3a8c49f792e46c4cf1 ("block/export: make
vhost-user-blk config space little-endian")
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20210223144653.811468-8-stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/export/vhost-user-blk-server.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/export/vhost-user-blk-server.c
b/block/export/vhost-user-blk-server.c
index ab2c4d44c4..7aea132f69 100644
--- a/block/export/vhost-user-blk-server.c
+++ b/block/export/vhost-user-blk-server.c
@@ -356,7 +356,7 @@ vu_blk_initialize_config(BlockDriverState *bs,
config->num_queues = cpu_to_le16(num_queues);
config->max_discard_sectors = cpu_to_le32(32768);
config->max_discard_seg = cpu_to_le32(1);
- config->discard_sector_alignment = cpu_to_le32(config->blk_size >> 9);
+ config->discard_sector_alignment = cpu_to_le32(blk_size >> 9);
config->max_write_zeroes_sectors = cpu_to_le32(32768);
config->max_write_zeroes_seg = cpu_to_le32(1);
}
--
2.29.2
- [PULL 21/31] block/export: port virtio-blk discard/write zeroes input validation, (continued)
- [PULL 21/31] block/export: port virtio-blk discard/write zeroes input validation, Kevin Wolf, 2021/03/05
- [PULL 23/31] block/export: port virtio-blk read/write range check, Kevin Wolf, 2021/03/05
- [PULL 03/31] backup-top: Refuse I/O in inactive state, Kevin Wolf, 2021/03/05
- [PULL 30/31] MAINTAINERS: update parallels block driver, Kevin Wolf, 2021/03/05
- [PULL 31/31] docs: qsd: Explain --export nbd,name=... default, Kevin Wolf, 2021/03/05
- [PULL 28/31] iotests.py: add unarchive_sample_image() helper, Kevin Wolf, 2021/03/05
- [PULL 24/31] qcow2-bitmap: make bytes_covered_by_bitmap_cluster() public, Kevin Wolf, 2021/03/05
- [PULL 07/31] storage-daemon: report unexpected arguments on the fly, Kevin Wolf, 2021/03/05
- [PULL 04/31] iotests/283: Check that finalize drops backup-top, Kevin Wolf, 2021/03/05
- [PULL 27/31] parallels: support bitmap extension for read-only mode, Kevin Wolf, 2021/03/05
- [PULL 18/31] block/export: fix blk_size double byteswap,
Kevin Wolf <=
- [PULL 22/31] vhost-user-blk-test: test discard/write zeroes invalid inputs, Kevin Wolf, 2021/03/05
- [PULL 29/31] iotests: add parallels-read-bitmap test, Kevin Wolf, 2021/03/05
- [PULL 16/31] test: new qTest case to test the vhost-user-blk-server, Kevin Wolf, 2021/03/05
- [PULL 12/31] vhost-user-blk: fix blkcfg->num_queues endianness, Kevin Wolf, 2021/03/05
- [PULL 14/31] libqtest: add qtest_kill_qemu(), Kevin Wolf, 2021/03/05
- Re: [PULL 00/31] Block layer patches, Peter Maydell, 2021/03/06