All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alberto Garcia <berto@igalia.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	John Snow <jsnow@redhat.com>
Subject: Re: [Qemu-devel] [PATCH for-2.11 5/5] qcow2: Refuse to get unaligned offsets from cache
Date: Tue, 14 Nov 2017 16:31:23 +0100	[thread overview]
Message-ID: <w51shdgzxkk.fsf@maestria.local.igalia.com> (raw)
In-Reply-To: <6b0680e6-e934-ac2c-659f-8e22ac2c3480@redhat.com>

On Tue 14 Nov 2017 04:09:16 PM CET, Max Reitz wrote:
>>> +static inline const char *qcow2_cache_get_name(BDRVQcow2State *s, Qcow2Cache *c)
>>> +{
>>> +    if (c == s->refcount_block_cache) {
>>> +        return "refcount block";
>>> +    } else if (c == s->l2_table_cache) {
>>> +        return "L2 table";
>>> +    } else {
>>> +        /* Do not abort, because this is not critical */
>>> +        return "unknown";
>>> +    }
>>> +}
>> 
>> Why is an unknown cache not critical?
>
> Because this is debugging information.

Ah, right, this is only used for qcow2_signal_corruption().

> I know others disagree with my opinion that I'd rather not abort qemu
> just because someone forgot to add a 'return "foo";' here when adding
> a new cache, but that's my opinion so I wanted to at least be told by
> someone that we should abort here before doing it.

I just checked the code and at least qcow2_cache_entry_flush() assumes
that there can be other caches, so this problem is not new.

Perhaps we should rethink this in the future and add a stronger
assertion somewhere else instead of having dead code, but for now this
is OK I guess.

Reviewed-by: Alberto Garcia <berto@igalia.com>

Berto

  reply	other threads:[~2017-11-14 15:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-10 20:31 [Qemu-devel] [PATCH for-2.11 0/5] qcow2: Fixes for corrupted images Max Reitz
2017-11-10 20:31 ` [Qemu-devel] [PATCH for-2.11 1/5] qcow2: check_errors are fatal Max Reitz
2017-11-10 20:55   ` Eric Blake
2017-11-10 20:31 ` [Qemu-devel] [PATCH for-2.11 2/5] qcow2: Unaligned zero cluster in handle_alloc() Max Reitz
2017-11-10 20:58   ` Eric Blake
2017-11-14 14:55   ` Alberto Garcia
2017-11-10 20:31 ` [Qemu-devel] [PATCH for-2.11 3/5] block: Guard against NULL bs->drv Max Reitz
2017-11-10 21:46   ` Eric Blake
2017-11-14 15:36     ` Max Reitz
2017-11-10 20:31 ` [Qemu-devel] [PATCH for-2.11 4/5] qcow2: Add bounds check to get_refblock_offset() Max Reitz
2017-11-10 21:49   ` Eric Blake
2017-11-14 15:02   ` Alberto Garcia
2017-11-14 15:27     ` Max Reitz
2017-11-14 15:38       ` Alberto Garcia
2017-11-14 15:40         ` Max Reitz
2017-11-10 20:31 ` [Qemu-devel] [PATCH for-2.11 5/5] qcow2: Refuse to get unaligned offsets from cache Max Reitz
2017-11-10 21:54   ` Eric Blake
2017-11-10 22:00     ` Max Reitz
2017-11-10 22:15       ` Eric Blake
2017-11-10 22:16         ` Max Reitz
2017-11-14 15:06   ` Alberto Garcia
2017-11-14 15:09     ` Max Reitz
2017-11-14 15:31       ` Alberto Garcia [this message]
2017-11-10 20:41 ` [Qemu-devel] [PATCH for-2.11 0/5] qcow2: Fixes for corrupted images Max Reitz
2017-11-15 20:25 ` Max Reitz

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=w51shdgzxkk.fsf@maestria.local.igalia.com \
    --to=berto@igalia.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.