block/io: fix bdrv_is_allocated_above
commit7e7e510077f386b7ec286c52f65b4552568bc65e
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 24 Sep 2020 19:40:02 +0000 (24 22:40 +0300)
committerStefan Hajnoczi <stefanha@redhat.com>
Fri, 23 Oct 2020 12:42:16 +0000 (23 13:42 +0100)
treece9dac70f7549c02d072945654352d3108405536
parent624f27bbe9615ba7a763ccc4632a4df5f0721fd0
block/io: fix bdrv_is_allocated_above

bdrv_is_allocated_above wrongly handles short backing files: it reports
after-EOF space as UNALLOCATED which is wrong, as on read the data is
generated on the level of short backing file (if all overlays have
unallocated areas at that place).

Reusing bdrv_common_block_status_above fixes the issue and unifies code
path.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20200924194003.22080-5-vsementsov@virtuozzo.com
[Fix s/has/have/ as suggested by Eric Blake. Fix s/area/areas/.
--Stefan]
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block/io.c