                  extent->l2_size * sizeof(uint32_t)
              ) != extent->l2_size * sizeof(uint32_t)) {
          return VMDK_ERROR;
-@@ -1090,15 +1235,15 @@ static int get_cluster_offset(BlockDriverState *bs,
+@@ -1090,15 +1235,15 @@
      extent->l2_cache_counts[min_index] = 1;
   found:
      l2_index = ((offset >> 9) / extent->cluster_sectors) % extent->l2_size;

     }
     ret = bdrv_pwrite(extent->file,
                         cluster_offset + offset_in_cluster,
@@ -1236,6 +1383,13 @@ static int vmdk_write_extent(VmdkExtent *extent, int64_t cluster_offset,
         ret = ret < 0 ? ret : -EIO;
         goto out;
     }

     ret = 0;
  out:
     g_free(data);
@@ -1534,10 +1688,12 @@
     int ret, i;
     BlockDriverState *bs = NULL;
     VMDK4Header header;
