[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 01/13] block/backup: fix backup_cow_with_offl
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH v9 01/13] block/backup: fix backup_cow_with_offload for last cluster |
Date: |
Wed, 28 Aug 2019 16:08:19 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 26.08.19 18:13, Vladimir Sementsov-Ogievskiy wrote:
> We shouldn't try to copy bytes beyond EOF. Fix it.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> block/backup.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/block/backup.c b/block/backup.c
> index 2baf7bed65..33b144305f 100644
> --- a/block/backup.c
> +++ b/block/backup.c
> @@ -161,7 +161,7 @@ static int coroutine_fn
> backup_cow_with_offload(BackupBlockJob *job,
>
> assert(QEMU_IS_ALIGNED(job->copy_range_size, job->cluster_size));
> assert(QEMU_IS_ALIGNED(start, job->cluster_size));
> - nbytes = MIN(job->copy_range_size, end - start);
> + nbytes = MIN(job->copy_range_size, MIN(end - start, job->len - start));
Might be easier to read as MIN(end, job->len) - start, but either way:
Reviewed-by: Max Reitz <address@hidden>
> nr_clusters = DIV_ROUND_UP(nbytes, job->cluster_size);
> bdrv_reset_dirty_bitmap(job->copy_bitmap, start,
> job->cluster_size * nr_clusters);
>
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-devel] [PATCH v9 02/13] block/backup: split shareable copying part from backup_do_cow, (continued)
[Qemu-devel] [PATCH v9 10/13] block/io: refactor wait_serialising_requests, Vladimir Sementsov-Ogievskiy, 2019/08/26
[Qemu-devel] [PATCH v9 04/13] block/backup: adjust block-copy functions style, Vladimir Sementsov-Ogievskiy, 2019/08/26
[Qemu-devel] [PATCH v9 11/13] block: add lock/unlock range functions, Vladimir Sementsov-Ogievskiy, 2019/08/26
[Qemu-devel] [PATCH v9 01/13] block/backup: fix backup_cow_with_offload for last cluster, Vladimir Sementsov-Ogievskiy, 2019/08/26
- Re: [Qemu-devel] [PATCH v9 01/13] block/backup: fix backup_cow_with_offload for last cluster,
Max Reitz <=
[Qemu-devel] [PATCH v9 12/13] block: introduce backup-top filter driver, Vladimir Sementsov-Ogievskiy, 2019/08/26
[Qemu-devel] [PATCH v9 09/13] iotests: 257: drop device_add, Vladimir Sementsov-Ogievskiy, 2019/08/26
[Qemu-devel] [PATCH v9 03/13] block/backup: introduce BlockCopyState, Vladimir Sementsov-Ogievskiy, 2019/08/26
[Qemu-devel] [PATCH v9 05/13] block: move block_copy from block/backup.c to separate file, Vladimir Sementsov-Ogievskiy, 2019/08/26