block: Fix harmless off-by-one in bdrv_aligned_preadv()
commit82524274eada16bfa2a263cbdbcae0fe948ed040
authorEric Blake <eblake@redhat.com>
Thu, 23 Jun 2016 22:37:07 +0000 (23 16:37 -0600)
committerKevin Wolf <kwolf@redhat.com>
Tue, 5 Jul 2016 14:46:24 +0000 (5 16:46 +0200)
tree924adc077bf00ed689f393b983d5fba83e5e9498
parenta604fa2ba55f645abbb082469ed595f58f657ac8
block: Fix harmless off-by-one in bdrv_aligned_preadv()

If the amount of data to read ends exactly on the total size
of the bs, then we were wasting time creating a local qiov
to read the data in preparation for what would normally be
appending zeroes beyond the end, even though this corner case
has nothing further to do.

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/io.c