qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	"qemu-block@nongnu.org" <qemu-block@nongnu.org>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Cc: "kwolf@redhat.com" <kwolf@redhat.com>, Denis Lunev <den@virtuozzo.com>
Subject: Re: [Qemu-devel] [PATCH v4 5/5] qcow2-refcount: don't mask corruptions under internal errors
Date: Wed, 27 Feb 2019 13:48:41 +0100	[thread overview]
Message-ID: <c097c89c-40ef-d3a5-ac4e-7adec1841029@redhat.com> (raw)
In-Reply-To: <1b6f86f0-1bf5-f306-b24a-ed37c3d9016a@virtuozzo.com>

[-- Attachment #1: Type: text/plain, Size: 2256 bytes --]

On 27.02.19 13:47, Vladimir Sementsov-Ogievskiy wrote:
> 27.02.2019 15:42, Max Reitz wrote:
>> On 14.12.18 14:42, Vladimir Sementsov-Ogievskiy wrote:
>>> No reasons for not reporting found corruptions as corruptions in case
>>> of some internal errors, especially in case of just failed to fix l2
>>> entry (and in this case, missed corruptions may influence comparing
>>> logic, when we calculate difference between corruptions fields of two
>>> results)
>>>
>>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>>> ---
>>>   block/qcow2-refcount.c | 31 ++++++++++++++-----------------
>>>   1 file changed, 14 insertions(+), 17 deletions(-)
>>>
>>> diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
>>> index 8da0e91dd3..b0e006e628 100644
>>> --- a/block/qcow2-refcount.c
>>> +++ b/block/qcow2-refcount.c
>>
>> [...]
>>
>>> @@ -1899,19 +1899,16 @@ static int check_oflag_copied(BlockDriverState *bs, BdrvCheckResult *res,
>>>                       fprintf(stderr, "%s OFLAG_COPIED data cluster: "
>>>                               "l2_entry=%" PRIx64 " refcount=%" PRIu64 "\n",
>>>                               repair ? "Repairing" : "ERROR", l2_entry, refcount);
>>> -                    if (repair) {
>>> -                        l2_table[j] = cpu_to_be64(refcount == 1
>>> -                                    ? l2_entry |  QCOW_OFLAG_COPIED
>>> -                                    : l2_entry & ~QCOW_OFLAG_COPIED);
>>> -                        l2_dirty++;
>>> -                    } else {
>>> -                        res->corruptions++;
>>> -                    }
>>> +                    l2_table[j] = cpu_to_be64(refcount == 1
>>> +                                ? l2_entry |  QCOW_OFLAG_COPIED
>>> +                                : l2_entry & ~QCOW_OFLAG_COPIED);
>>> +                    l2_dirty++;
>>
>> I found the old logic to be easier to understand, actually.  It made it
>> clear that if !repair, the L2 table is not going to be touched.
>>
>> Max
>>
> 
> so,
> 
>    if (repair) {
>       keep as is
>    }
>    res->corruptions++;
> 
> ok?

Yep, that works for me.  Or above the fprintf() as you did it in other
places in this patch.

Max


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-02-27 13:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-14 13:42 [Qemu-devel] [PATCH v4 0/5] qcow2 check improvements part I Vladimir Sementsov-Ogievskiy
2018-12-14 13:42 ` [Qemu-devel] [PATCH v4 1/5] qcow2-refcount: fix check_oflag_copied Vladimir Sementsov-Ogievskiy
2019-02-27 12:02   ` Max Reitz
2018-12-14 13:42 ` [Qemu-devel] [PATCH v4 2/5] qcow2-refcount: avoid eating RAM Vladimir Sementsov-Ogievskiy
2019-02-27 12:26   ` Max Reitz
2019-02-27 14:43   ` Eric Blake
2018-12-14 13:42 ` [Qemu-devel] [PATCH v4 3/5] qcow2-refcount: check_refcounts_l2: reduce ignored overlaps Vladimir Sementsov-Ogievskiy
2018-12-14 13:42 ` [Qemu-devel] [PATCH v4 4/5] qcow2-refcount: check_refcounts_l2: don't count fixed cluster as allocated Vladimir Sementsov-Ogievskiy
2019-02-27 12:32   ` Max Reitz
2018-12-14 13:42 ` [Qemu-devel] [PATCH v4 5/5] qcow2-refcount: don't mask corruptions under internal errors Vladimir Sementsov-Ogievskiy
2019-02-27 12:42   ` Max Reitz
2019-02-27 12:47     ` Vladimir Sementsov-Ogievskiy
2019-02-27 12:48       ` Max Reitz [this message]
2019-01-10 15:28 ` [Qemu-devel] [PATCH v4 0/5] qcow2 check improvements part I Vladimir Sementsov-Ogievskiy
2019-02-27 10:07   ` Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c097c89c-40ef-d3a5-ac4e-7adec1841029@redhat.com \
    --to=mreitz@redhat.com \
    --cc=den@virtuozzo.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).