[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3] qcow2: Rewrite qcow2_alloc_bytes()
From: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH v3] qcow2: Rewrite qcow2_alloc_bytes() |
Date: |
Fri, 6 Feb 2015 16:01:18 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Am 06.02.2015 um 15:39 hat Max Reitz geschrieben:
> qcow2_alloc_bytes() is a function with insufficient error handling and
> an unnecessary goto. This patch rewrites it.
>
> Signed-off-by: Max Reitz <address@hidden>
> ---
> v3:
> - Use alloc_clusters_noref() and update_refcount() [Kevin]
> - Only modify s->free_byte_offset if the function is successful; this is
> now necessary because update_refcount() is called unconditionally and
> thus, if it failed and alloc_clusters_noref() had been called and
> had returned a non-contiguous offset, s->free_byte_offset would point
> to an unallocated cluster's head, which is both wrong in itself and
> would also violate the assertion at the beginning of the function
Looks much nicer, I think. :-)
Thanks, applied to the block branch.
Kevin