block: don't lose data from last incomplete sector
commitbcb9d66e8590151967e1dbe3724eec7ec71392e0
authorFam Zheng <famz@redhat.com>
Wed, 18 Sep 2013 11:14:14 +0000 (18 19:14 +0800)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 20 Sep 2013 17:27:26 +0000 (20 19:27 +0200)
tree1e2d79ec373aa30aade110774e6df3f452d88201
parent0f39ac9a07cc10278e37d87076b143008f28aa3b
block: don't lose data from last incomplete sector

To read the last sector that is not aligned to sector boundary, current
code for growable backends, since commit 893a8f6 "block: Produce zeros
when protocols reading beyond end of file", drops the data and directly
returns zeroes. That is incorrect.

Signed-off-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block.c