From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vd9KS-0000nI-48 for qemu-devel@nongnu.org; Sun, 03 Nov 2013 20:51:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vd9KJ-0001X2-6B for qemu-devel@nongnu.org; Sun, 03 Nov 2013 20:51:44 -0500 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:45828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vd9KH-0001Ws-Ld for qemu-devel@nongnu.org; Sun, 03 Nov 2013 20:51:35 -0500 Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 4 Nov 2013 11:51:23 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 18DB73578052 for ; Mon, 4 Nov 2013 12:51:20 +1100 (EST) Received: from d23av03.au.ibm.com (d23av03.au.ibm.com [9.190.234.97]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id rA41p7MA46989430 for ; Mon, 4 Nov 2013 12:51:08 +1100 Received: from d23av03.au.ibm.com (localhost [127.0.0.1]) by d23av03.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id rA41pJQE009902 for ; Mon, 4 Nov 2013 12:51:19 +1100 Message-ID: <5276FD99.8040301@linux.vnet.ibm.com> Date: Mon, 04 Nov 2013 09:51:21 +0800 From: Wenchao Xia MIME-Version: 1.0 References: <1381787553-12497-1-git-send-email-xiawenc@linux.vnet.ibm.com> <1381787553-12497-4-git-send-email-xiawenc@linux.vnet.ibm.com> <5274F86D.8070009@redhat.com> <52750493.4090907@redhat.com> In-Reply-To: <52750493.4090907@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH V4 3/6] qcow2: do not free clusters when fail in header update in qcow2_write_snapshots List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz , qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@gmail.com 于 2013/11/2 21:56, Max Reitz 写道: > On 02.11.2013 14:04, Max Reitz wrote: >> On 14.10.2013 23:52, Wenchao Xia wrote: >>> Signed-off-by: Wenchao Xia >>> --- >>> block/qcow2-snapshot.c | 7 +++++++ >>> 1 files changed, 7 insertions(+), 0 deletions(-) >>> >>> diff --git a/block/qcow2-snapshot.c b/block/qcow2-snapshot.c >>> index 4bd494b..c933b7f 100644 >>> --- a/block/qcow2-snapshot.c >>> +++ b/block/qcow2-snapshot.c >>> @@ -304,6 +304,13 @@ static int qcow2_write_snapshots(BlockDriverState *bs, Error **errp) >>> PRIi64 " with size %" PRIu64 ":%d (%s)", >>> offsetof(QCowHeader, nb_snapshots), sizeof(header_data), >>> ret, strerror(-ret)); >>> + /* >>> + * If the snapshot data part have been updated on disk, Then the >> s/have/has/; s/Then/then/ >> >>> + * clusters at snapshot_offset may be used in next snapshot operation. >>> + * If we free those clusters in fail path, they may be allocated and >>> + * made dirty causing damage, so skip cluster free for safe. >> s/for/to be/ >> >>> + */ >>> + snapshots_offset = 0; >>> goto fail; >>> } >> Other then that: Reviewed-by: Max Reitz > > *than, of course; if I am already correcting other people's orthography, > I have to do the same for mine. ;-) > > Max > Thanks for reviewing, I'll fix the issues you pointed out and respin.