Skip to content

Commit

Permalink
block: Fix multiwrite with overlapping requests
Browse files Browse the repository at this point in the history
With overlapping requests, the total number of sectors is smaller than the sum
of the nb_sectors of both requests.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
kevmw committed May 28, 2010
1 parent 175e115 commit cbf1dff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion block.c
Original file line number Diff line number Diff line change
Expand Up @@ -2019,7 +2019,7 @@ static int multiwrite_merge(BlockDriverState *bs, BlockRequest *reqs,
// Add the second request
qemu_iovec_concat(qiov, reqs[i].qiov, reqs[i].qiov->size);

reqs[outidx].nb_sectors += reqs[i].nb_sectors;
reqs[outidx].nb_sectors = qiov->size >> 9;
reqs[outidx].qiov = qiov;

mcb->callbacks[i].free_qiov = reqs[outidx].qiov;
Expand Down

0 comments on commit cbf1dff

Please sign in to comment.