[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 07/10] block: Use common req handling for dis
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v3 07/10] block: Use common req handling for discard |
Date: |
Tue, 10 Jul 2018 16:45:43 +0200 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
Am 10.07.2018 um 08:31 hat Fam Zheng geschrieben:
> Reuse the new bdrv_co_write_req_prepare/finish helpers. The variation
> here is that discard requests don't affect bs->wr_highest_offset, and it
> cannot extend the image.
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> block/io.c | 32 ++++++++++++++++++++++----------
> 1 file changed, 22 insertions(+), 10 deletions(-)
>
> diff --git a/block/io.c b/block/io.c
> index 10a475302a..cc426bab2e 100644
> --- a/block/io.c
> +++ b/block/io.c
> @@ -1601,15 +1601,31 @@ bdrv_co_write_req_finish(BdrvChild *child, int64_t
> offset, uint64_t bytes,
>
> atomic_inc(&bs->write_gen);
>
> - stat64_max(&bs->wr_highest_offset, offset + bytes);
> -
> + /* Discard cannot extend the image, but in error handling cases, such as
> + * when reverting a qcow2 cluster allocation, the discarded range can
> pass
> + * the end of image file, so we cannot assert about BDRV_TRACKED_DISCARD
> + * here. Instead, just skip it, since semantically a discard request
> + * beyond EOF cannot expand the image anyway.
> + * */
Oh, yet another style for the end of a multiline comment. :-)
I'll fix this while applying.
Kevin
- [Qemu-devel] [PATCH v3 00/10] block: Fix dst reading after tail copy offloading, Fam Zheng, 2018/07/10
- [Qemu-devel] [PATCH v3 01/10] block: Prefix file driver trace points with "file_", Fam Zheng, 2018/07/10
- [Qemu-devel] [PATCH v3 02/10] block: Add copy offloading trace points, Fam Zheng, 2018/07/10
- [Qemu-devel] [PATCH v3 03/10] block: Use BdrvChild to discard, Fam Zheng, 2018/07/10
- [Qemu-devel] [PATCH v3 04/10] block: Use uint64_t for BdrvTrackedRequest byte fields, Fam Zheng, 2018/07/10
- [Qemu-devel] [PATCH v3 05/10] block: Extract common write req handling, Fam Zheng, 2018/07/10
- [Qemu-devel] [PATCH v3 06/10] block: Fix handling of image enlarging write, Fam Zheng, 2018/07/10
- [Qemu-devel] [PATCH v3 07/10] block: Use common req handling for discard, Fam Zheng, 2018/07/10
- Re: [Qemu-devel] [PATCH v3 07/10] block: Use common req handling for discard,
Kevin Wolf <=
- [Qemu-devel] [PATCH v3 08/10] block: Use common req handling in copy offloading, Fam Zheng, 2018/07/10
- [Qemu-devel] [PATCH v3 09/10] block: Fix bdrv_co_truncate overlap check, Fam Zheng, 2018/07/10
- [Qemu-devel] [PATCH v3 10/10] block: Use common write req handling in truncate, Fam Zheng, 2018/07/10
- Re: [Qemu-devel] [PATCH v3 00/10] block: Fix dst reading after tail copy offloading, Kevin Wolf, 2018/07/10