diff mbox series

[2/3] vmdk: Make block_status recurse for flat extents

Message ID 20190725155512.9827-3-mreitz@redhat.com (mailing list archive)
State New, archived
Headers show
Series block: Make various formats' block_status recurse again | expand

Commit Message

Max Reitz July 25, 2019, 3:55 p.m. UTC
Fixes: 69f47505ee66afaa513305de0c1895a224e52c45
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/vmdk.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Vladimir Sementsov-Ogievskiy Aug. 12, 2019, 2:59 p.m. UTC | #1
25.07.2019 18:55, Max Reitz wrote:
> Fixes: 69f47505ee66afaa513305de0c1895a224e52c45
> Signed-off-by: Max Reitz <mreitz@redhat.com>

Again, don't know vmdk code, but briefly looking at it (and at vmdk spec) I
see that "extents" are files, and flat extent is a raw file without any special
format. And it is allocated by blk_truncate(.. PREALLOC_MODE_OFF ..), so really
looks like metadata preallocation.

And, any way, there should not be real damage, as patch simply brings back old behavior
for one case.

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

> ---
>   block/vmdk.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/block/vmdk.c b/block/vmdk.c
> index bd36ece125..fd78fd0ccf 100644
> --- a/block/vmdk.c
> +++ b/block/vmdk.c
> @@ -1692,6 +1692,9 @@ static int coroutine_fn vmdk_co_block_status(BlockDriverState *bs,
>           if (!extent->compressed) {
>               ret |= BDRV_BLOCK_OFFSET_VALID;
>               *map = cluster_offset + index_in_cluster;
> +            if (extent->flat) {
> +                ret |= BDRV_BLOCK_RECURSE;
> +            }
>           }
>           *file = extent->file->bs;
>           break;
>
diff mbox series

Patch

diff --git a/block/vmdk.c b/block/vmdk.c
index bd36ece125..fd78fd0ccf 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -1692,6 +1692,9 @@  static int coroutine_fn vmdk_co_block_status(BlockDriverState *bs,
         if (!extent->compressed) {
             ret |= BDRV_BLOCK_OFFSET_VALID;
             *map = cluster_offset + index_in_cluster;
+            if (extent->flat) {
+                ret |= BDRV_BLOCK_RECURSE;
+            }
         }
         *file = extent->file->bs;
         break;