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 <mre...@redhat.com> > --- > 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