qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Re: [PATCH] qcow2: don't ignore failed update_refcount


From: Kevin Wolf
Subject: [Qemu-devel] Re: [PATCH] qcow2: don't ignore failed update_refcount
Date: Mon, 08 Feb 2010 16:18:56 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0

Am 08.02.2010 16:01, schrieb Jim Meyering:
> update_refcount is marked as a function for which we must use its result,
> 
>     static int QEMU_WARN_UNUSED_RESULT update_refcount(BlockDriverState *bs,
> 
> and rightly so, since doing otherwise would amount to ignoring write failure.
> However, there are two cases in which the return value is currently ignored.
> This fixes them:
> 
> From 107940556a2d0ef1de1d59a5da0c6c3086246817 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <address@hidden>
> Date: Mon, 8 Feb 2010 11:50:59 +0100
> Subject: [PATCH] qcow2: don't ignore failed update_refcount
> 
> * block/qcow2-refcount.c (grow_refcount_table): When update_refcount
> fails, return its negative return code to our caller.
> (alloc_refcount_block): Likewise.

I'm currently working on fixing exactly this, and unfortunaly, no, it's
not that easy. What you introduce looks like proper error handling at
first sight, but what happens in fact is that while the current write
request correctly fails now we're running with corrupted metadata for
all future requests (the new refcount table/block is already in use, but
it has a refcount of 0 and will be overwritten sooner or later).

Actually, I have found it impossible to fix the current approach, so the
fix I'm working on will be more of a rewrite of the two functions.

Kevin




reply via email to

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