From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCQ2d-0003hq-IS for qemu-devel@nongnu.org; Sun, 09 Feb 2014 03:47:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WCQ2X-0001Aa-JF for qemu-devel@nongnu.org; Sun, 09 Feb 2014 03:47:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59409) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCQ2X-0001AT-C8 for qemu-devel@nongnu.org; Sun, 09 Feb 2014 03:47:01 -0500 From: Kevin Wolf Date: Sun, 9 Feb 2014 09:46:27 +0100 Message-Id: <1391935590-12264-16-git-send-email-kwolf@redhat.com> In-Reply-To: <1391935590-12264-1-git-send-email-kwolf@redhat.com> References: <1391935590-12264-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PULL 15/18] block: bdrv_aligned_pwritev: Assert overlap range List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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 Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Laszlo Ersek --- 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