On Mon, Jan 18, 2010 at 01:11:33PM +0100, Kevin Wolf wrote: > If update_refcount fails, try to undo any changes made so far to avoid > inconsistencies in the image file. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > block/qcow2-refcount.c | 32 +++++++++++++++++++++++++------- > 1 files changed, 25 insertions(+), 7 deletions(-) >
> + /* > + * Try do undo any updates if an error is returned (This may succeed in > + * some cases like ENOSPC for allocating a new refcount block) > + */ > + if (ret < 0) { > + int dummy; > + dummy = update_refcount(bs, offset, cluster_offset - offset, > -addend); So we recursively call into update_refcount here. What happens an error causes all updates to fail?