diff mbox series

qcow2: Use L1E_SIZE in qcow2_write_l1_entry()

Message ID 20200928162333.14998-1-berto@igalia.com (mailing list archive)
State New, archived
Headers show
Series qcow2: Use L1E_SIZE in qcow2_write_l1_entry() | expand

Commit Message

Alberto Garcia Sept. 28, 2020, 4:23 p.m. UTC
We overlooked these in 02b1ecfa100e7ecc2306560cd27a4a2622bfeb04

Signed-off-by: Alberto Garcia <berto@igalia.com>
---
 block/qcow2-cluster.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Eric Blake Sept. 29, 2020, 4:08 p.m. UTC | #1
On 9/28/20 11:23 AM, Alberto Garcia wrote:
> We overlooked these in 02b1ecfa100e7ecc2306560cd27a4a2622bfeb04
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>
> ---
>  block/qcow2-cluster.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Eric Blake <eblake@redhat.com>

> diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
> index 9acc6ce4ae..aa87d3e99b 100644
> --- a/block/qcow2-cluster.c
> +++ b/block/qcow2-cluster.c
> @@ -240,14 +240,14 @@ int qcow2_write_l1_entry(BlockDriverState *bs, int l1_index)
>      }
>  
>      ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_ACTIVE_L1,
> -            s->l1_table_offset + 8 * l1_start_index, bufsize, false);
> +            s->l1_table_offset + L1E_SIZE * l1_start_index, bufsize, false);
>      if (ret < 0) {
>          return ret;
>      }
>  
>      BLKDBG_EVENT(bs->file, BLKDBG_L1_UPDATE);
>      ret = bdrv_pwrite_sync(bs->file,
> -                           s->l1_table_offset + 8 * l1_start_index,
> +                           s->l1_table_offset + L1E_SIZE * l1_start_index,
>                             buf, bufsize);
>      if (ret < 0) {
>          return ret;
>
Kevin Wolf Oct. 2, 2020, 7:52 a.m. UTC | #2
Am 28.09.2020 um 18:23 hat Alberto Garcia geschrieben:
> We overlooked these in 02b1ecfa100e7ecc2306560cd27a4a2622bfeb04
> 
> Signed-off-by: Alberto Garcia <berto@igalia.com>

Thanks, applied to the block branch.

Kevin
diff mbox series

Patch

diff --git a/block/qcow2-cluster.c b/block/qcow2-cluster.c
index 9acc6ce4ae..aa87d3e99b 100644
--- a/block/qcow2-cluster.c
+++ b/block/qcow2-cluster.c
@@ -240,14 +240,14 @@  int qcow2_write_l1_entry(BlockDriverState *bs, int l1_index)
     }
 
     ret = qcow2_pre_write_overlap_check(bs, QCOW2_OL_ACTIVE_L1,
-            s->l1_table_offset + 8 * l1_start_index, bufsize, false);
+            s->l1_table_offset + L1E_SIZE * l1_start_index, bufsize, false);
     if (ret < 0) {
         return ret;
     }
 
     BLKDBG_EVENT(bs->file, BLKDBG_L1_UPDATE);
     ret = bdrv_pwrite_sync(bs->file,
-                           s->l1_table_offset + 8 * l1_start_index,
+                           s->l1_table_offset + L1E_SIZE * l1_start_index,
                            buf, bufsize);
     if (ret < 0) {
         return ret;