Skip to content

Commit

Permalink
block: bdrv_aligned_pwritev: Assert overlap range
Browse files Browse the repository at this point in the history
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 <lersek@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
  • Loading branch information
kevmw committed Feb 9, 2014
1 parent 99c4a85 commit af91f9a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions block.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit af91f9a

Please sign in to comment.