qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 15/18] block: bdrv_aligned_pwritev: Assert overlap ra


From: Kevin Wolf
Subject: [Qemu-devel] [PULL 15/18] block: bdrv_aligned_pwritev: Assert overlap range
Date: Sun, 9 Feb 2014 09:46:27 +0100

This adds assertions that the request that we actually end up passing to
the block driver (which includes RMW data and has therefore potentially
been rounded to alignment boundaries) is fully covered by the
overlap_{offset,size} fields of the associated BdrvTrackedRequest.

Suggested-by: Laszlo Ersek <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
---
 block.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block.c b/block.c
index c1d1f74..a027823 100644
--- a/block.c
+++ b/block.c
@@ -3134,6 +3134,8 @@ static int coroutine_fn 
bdrv_aligned_pwritev(BlockDriverState *bs,
 
     waited = wait_serialising_requests(req);
     assert(!waited || !req->serialising);
+    assert(req->overlap_offset <= offset);
+    assert(offset + bytes <= req->overlap_offset + req->overlap_bytes);
 
     ret = notifier_with_return_list_notify(&bs->before_write_notifiers, req);
 
-- 
1.8.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]