bdrv_is_allocated_above() returns true in the case even for completel zeroed areas as BDRV_BLOCK_ALLOCATED flag is set in both cases.
The patch stops using bdrv_is_allocated_above() wrapper and switches to bdrv_get_block_status_above() to distinguish zeroed areas and areas with data to avoid extra IO operations if possible. Though this change requires some preparations in bdrv_get_block_status_above() performed in the patch (1). Changes from v1: - fixed assert in 041 test case (added patch 1) - fixed commit message - fixed status check to be on the safe side Signed-off-by: Denis V. Lunev <d...@openvz.org> CC: Stefan Hajnoczi <stefa...@redhat.com> CC: Fam Zheng <f...@redhat.com> CC: Kevin Wolf <kw...@redhat.com> CC: Max Reitz <mre...@redhat.com> CC: Jeff Cody <jc...@redhat.com> Denis V. Lunev (2): block: sync bdrv_co_get_block_status_above() with bdrv_is_allocated_above() mirror: fix improperly filled copy_bitmap for mirror block job block/io.c | 26 ++++++++++++++++++++------ block/mirror.c | 18 ++++++++++++------ 2 files changed, 32 insertions(+), 12 deletions(-) -- 2.7.4