* [Qemu-devel] [PATCH] qcow2: Remove abort on free_clusters failure
@ 2010-04-27 10:35 Kevin Wolf
2010-04-27 12:52 ` Stefan Hajnoczi
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Wolf @ 2010-04-27 10:35 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf
While it's true that during regular operation free_clusters failure would be a
bug, an I/O error can always happen. There's no need to kill the VM, the worst
thing that can happen (and it will) is that we leak some clusters.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/qcow2-refcount.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
index 95491d3..744107c 100644
--- a/block/qcow2-refcount.c
+++ b/block/qcow2-refcount.c
@@ -638,7 +638,7 @@ void qcow2_free_clusters(BlockDriverState *bs,
ret = update_refcount(bs, offset, size, -1);
if (ret < 0) {
fprintf(stderr, "qcow2_free_clusters failed: %s\n", strerror(-ret));
- abort();
+ /* TODO Remember the clusters to free them later and avoid leaking */
}
}
--
1.6.6.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] qcow2: Remove abort on free_clusters failure
2010-04-27 10:35 [Qemu-devel] [PATCH] qcow2: Remove abort on free_clusters failure Kevin Wolf
@ 2010-04-27 12:52 ` Stefan Hajnoczi
2010-04-27 12:56 ` Kevin Wolf
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2010-04-27 12:52 UTC (permalink / raw)
To: Kevin Wolf; +Cc: qemu-devel
On Tue, Apr 27, 2010 at 11:35 AM, Kevin Wolf <kwolf@redhat.com> wrote:
> --- a/block/qcow2-refcount.c
> +++ b/block/qcow2-refcount.c
> @@ -638,7 +638,7 @@ void qcow2_free_clusters(BlockDriverState *bs,
> ret = update_refcount(bs, offset, size, -1);
> if (ret < 0) {
> fprintf(stderr, "qcow2_free_clusters failed: %s\n", strerror(-ret));
> - abort();
> + /* TODO Remember the clusters to free them later and avoid leaking */
> }
> }
Has there been discussion on a fix mode for qemu-img check? For qcow2
it could write new refcounts, calculated by traversing the L1/L2
tables of the image and snapshots. Perhaps it would also dump out the
orphaned clusters to a lost+found.
Stefan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PATCH] qcow2: Remove abort on free_clusters failure
2010-04-27 12:52 ` Stefan Hajnoczi
@ 2010-04-27 12:56 ` Kevin Wolf
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2010-04-27 12:56 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: qemu-devel
Am 27.04.2010 14:52, schrieb Stefan Hajnoczi:
> On Tue, Apr 27, 2010 at 11:35 AM, Kevin Wolf <kwolf@redhat.com> wrote:
>> --- a/block/qcow2-refcount.c
>> +++ b/block/qcow2-refcount.c
>> @@ -638,7 +638,7 @@ void qcow2_free_clusters(BlockDriverState *bs,
>> ret = update_refcount(bs, offset, size, -1);
>> if (ret < 0) {
>> fprintf(stderr, "qcow2_free_clusters failed: %s\n", strerror(-ret));
>> - abort();
>> + /* TODO Remember the clusters to free them later and avoid leaking */
>> }
>> }
>
> Has there been discussion on a fix mode for qemu-img check? For qcow2
> it could write new refcounts, calculated by traversing the L1/L2
> tables of the image and snapshots. Perhaps it would also dump out the
> orphaned clusters to a lost+found.
No real discussion, but it's somewhere among the low priority tasks on
my todo list. So I agree this would make sense, at least for the trivial
errors.
Another thing I was considering is to distinguish between errors and
warnings in qemu-img check. I keep getting reports about image
corruption which turn out to be just some leaked clusters because they
killed their qemu process at some point.
Kevin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-27 12:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27 10:35 [Qemu-devel] [PATCH] qcow2: Remove abort on free_clusters failure Kevin Wolf
2010-04-27 12:52 ` Stefan Hajnoczi
2010-04-27 12:56 ` Kevin Wolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).