[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 18/18] block: Fix 32 bit truncation in mark_request_s
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 18/18] block: Fix 32 bit truncation in mark_request_serialising() |
Date: |
Sun, 9 Feb 2014 09:46:30 +0100 |
On 32 bit hosts, size_t is too small for align as the bitmask
~(align - 1) will zero out the higher 32 bits of the offset.
While at it, change the local overlap_bytes variable to unsigned to
match the field in BdrvTrackedRequest.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
---
block.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/block.c b/block.c
index b0c5025..636aa11 100644
--- a/block.c
+++ b/block.c
@@ -2240,11 +2240,11 @@ static void tracked_request_begin(BdrvTrackedRequest
*req,
QLIST_INSERT_HEAD(&bs->tracked_requests, req, list);
}
-static void mark_request_serialising(BdrvTrackedRequest *req, size_t align)
+static void mark_request_serialising(BdrvTrackedRequest *req, uint64_t align)
{
int64_t overlap_offset = req->offset & ~(align - 1);
- int overlap_bytes = ROUND_UP(req->offset + req->bytes, align)
- - overlap_offset;
+ unsigned int overlap_bytes = ROUND_UP(req->offset + req->bytes, align)
+ - overlap_offset;
if (!req->serialising) {
req->bs->serialising_in_flight++;
--
1.8.1.4
- [Qemu-devel] [PULL 09/18] qcow2: remove n_start and n_end of qcow2_alloc_cluster_offset(), (continued)
- [Qemu-devel] [PULL 09/18] qcow2: remove n_start and n_end of qcow2_alloc_cluster_offset(), Kevin Wolf, 2014/02/09
- [Qemu-devel] [PULL 07/18] block: Fail gracefully with missing filename, Kevin Wolf, 2014/02/09
- [Qemu-devel] [PULL 10/18] qcow2: fix offset overflow in qcow2_alloc_clusters_at(), Kevin Wolf, 2014/02/09
- [Qemu-devel] [PULL 11/18] qcow2: check for NULL l2meta, Kevin Wolf, 2014/02/09
- [Qemu-devel] [PULL 12/18] qemu-iotests: add test for qcow2 preallocation with different cluster sizes, Kevin Wolf, 2014/02/09
- [Qemu-devel] [PULL 13/18] raw: Fix BlockLimits passthrough, Kevin Wolf, 2014/02/09
- [Qemu-devel] [PULL 14/18] block: Fix memory leaks in bdrv_co_do_pwritev(), Kevin Wolf, 2014/02/09
- [Qemu-devel] [PULL 15/18] block: bdrv_aligned_pwritev: Assert overlap range, Kevin Wolf, 2014/02/09
- [Qemu-devel] [PULL 16/18] block: Don't call ROUND_UP with negative values, Kevin Wolf, 2014/02/09
- [Qemu-devel] [PULL 17/18] blkdebug: Don't leak bs->file on failure, Kevin Wolf, 2014/02/09
- [Qemu-devel] [PULL 18/18] block: Fix 32 bit truncation in mark_request_serialising(),
Kevin Wolf <=
- Re: [Qemu-devel] [PULL 00/18] Block patches, Peter Maydell, 2014/02/12