qemu-devel
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]