From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: kwolf@redhat.com, mreitz@redhat.com, fam@euphon.net,
stefanha@redhat.com, den@virtuozzo.com
Subject: Re: [Qemu-devel] [PATCH v3 1/3] block/qcow2-refcount: add trace-point to qcow2_process_discards
Date: Mon, 22 Apr 2019 08:36:37 -0500 [thread overview]
Message-ID: <0eaf7740-a524-1ef4-27f7-7a0bf0be3222@redhat.com> (raw)
In-Reply-To: <20190419140557.102725-2-vsementsov@virtuozzo.com>
[-- Attachment #1: Type: text/plain, Size: 2217 bytes --]
On 4/19/19 9:05 AM, Vladimir Sementsov-Ogievskiy wrote:
> Let's at least trace ignored failure.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> block/qcow2-refcount.c | 7 ++++++-
> block/trace-events | 3 +++
> 2 files changed, 9 insertions(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
> index e0fe322500..60284bcaac 100644
> --- a/block/qcow2-refcount.c
> +++ b/block/qcow2-refcount.c
> @@ -30,6 +30,7 @@
> #include "qemu/range.h"
> #include "qemu/bswap.h"
> #include "qemu/cutils.h"
> +#include "trace.h"
>
> static int64_t alloc_clusters_noref(BlockDriverState *bs, uint64_t size,
> uint64_t max);
> @@ -738,7 +739,11 @@ void qcow2_process_discards(BlockDriverState *bs, int ret)
>
> /* Discard is optional, ignore the return value */
> if (ret >= 0) {
> - bdrv_pdiscard(bs->file, d->offset, d->bytes);
> + int r2 = bdrv_pdiscard(bs->file, d->offset, d->bytes);
> + if (r2 < 0) {
> + trace_qcow2_process_discards_failed_region(d->offset, d->bytes,
> + r2);
> + }
> }
>
> g_free(d);
> diff --git a/block/trace-events b/block/trace-events
> index 7335a42540..ea508f637e 100644
> --- a/block/trace-events
> +++ b/block/trace-events
> @@ -91,6 +91,9 @@ qcow2_cache_get_done(void *co, int c, int i) "co %p is_l2_cache %d index %d"
> qcow2_cache_flush(void *co, int c) "co %p is_l2_cache %d"
> qcow2_cache_entry_flush(void *co, int c, int i) "co %p is_l2_cache %d index %d"
>
> +# qcow2-refcount.c
> +qcow2_process_discards_failed_region(uint64_t offset, uint64_t bytes, int ret) "offset 0x%" PRIx64 " bytes 0x%" PRIx64 " ret %d"
> +
> # qed-l2-cache.c
> qed_alloc_l2_cache_entry(void *l2_cache, void *entry) "l2_cache %p entry %p"
> qed_unref_l2_cache_entry(void *entry, int ref) "entry %p ref %d"
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: kwolf@redhat.com, fam@euphon.net, den@virtuozzo.com,
stefanha@redhat.com, mreitz@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 1/3] block/qcow2-refcount: add trace-point to qcow2_process_discards
Date: Mon, 22 Apr 2019 08:36:37 -0500 [thread overview]
Message-ID: <0eaf7740-a524-1ef4-27f7-7a0bf0be3222@redhat.com> (raw)
Message-ID: <20190422133637.zT7yxU3yHdHuuq0Ak_dII1sdb346XMn5l2L_Svjv9Yg@z> (raw)
In-Reply-To: <20190419140557.102725-2-vsementsov@virtuozzo.com>
[-- Attachment #1: Type: text/plain, Size: 2217 bytes --]
On 4/19/19 9:05 AM, Vladimir Sementsov-Ogievskiy wrote:
> Let's at least trace ignored failure.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> ---
> block/qcow2-refcount.c | 7 ++++++-
> block/trace-events | 3 +++
> 2 files changed, 9 insertions(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/block/qcow2-refcount.c b/block/qcow2-refcount.c
> index e0fe322500..60284bcaac 100644
> --- a/block/qcow2-refcount.c
> +++ b/block/qcow2-refcount.c
> @@ -30,6 +30,7 @@
> #include "qemu/range.h"
> #include "qemu/bswap.h"
> #include "qemu/cutils.h"
> +#include "trace.h"
>
> static int64_t alloc_clusters_noref(BlockDriverState *bs, uint64_t size,
> uint64_t max);
> @@ -738,7 +739,11 @@ void qcow2_process_discards(BlockDriverState *bs, int ret)
>
> /* Discard is optional, ignore the return value */
> if (ret >= 0) {
> - bdrv_pdiscard(bs->file, d->offset, d->bytes);
> + int r2 = bdrv_pdiscard(bs->file, d->offset, d->bytes);
> + if (r2 < 0) {
> + trace_qcow2_process_discards_failed_region(d->offset, d->bytes,
> + r2);
> + }
> }
>
> g_free(d);
> diff --git a/block/trace-events b/block/trace-events
> index 7335a42540..ea508f637e 100644
> --- a/block/trace-events
> +++ b/block/trace-events
> @@ -91,6 +91,9 @@ qcow2_cache_get_done(void *co, int c, int i) "co %p is_l2_cache %d index %d"
> qcow2_cache_flush(void *co, int c) "co %p is_l2_cache %d"
> qcow2_cache_entry_flush(void *co, int c, int i) "co %p is_l2_cache %d index %d"
>
> +# qcow2-refcount.c
> +qcow2_process_discards_failed_region(uint64_t offset, uint64_t bytes, int ret) "offset 0x%" PRIx64 " bytes 0x%" PRIx64 " ret %d"
> +
> # qed-l2-cache.c
> qed_alloc_l2_cache_entry(void *l2_cache, void *entry) "l2_cache %p entry %p"
> qed_unref_l2_cache_entry(void *entry, int ref) "entry %p ref %d"
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2019-04-22 13:36 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-19 14:05 [Qemu-devel] [PATCH v3 0/3] Fix overflow bug in qcow2 discard Vladimir Sementsov-Ogievskiy
2019-04-19 14:05 ` Vladimir Sementsov-Ogievskiy
2019-04-19 14:05 ` [Qemu-devel] [PATCH v3 1/3] block/qcow2-refcount: add trace-point to qcow2_process_discards Vladimir Sementsov-Ogievskiy
2019-04-19 14:05 ` Vladimir Sementsov-Ogievskiy
2019-04-22 13:36 ` Eric Blake [this message]
2019-04-22 13:36 ` Eric Blake
2019-04-19 14:05 ` [Qemu-devel] [PATCH v3 2/3] block/io: bdrv_pdiscard: support int64_t bytes parameter Vladimir Sementsov-Ogievskiy
2019-04-19 14:05 ` Vladimir Sementsov-Ogievskiy
2019-04-22 13:39 ` Eric Blake
2019-04-22 13:39 ` Eric Blake
2019-04-19 14:05 ` [Qemu-devel] [PATCH v3 3/3] iotests: test big qcow2 shrink Vladimir Sementsov-Ogievskiy
2019-04-19 14:05 ` Vladimir Sementsov-Ogievskiy
2019-04-22 13:59 ` Eric Blake
2019-04-22 13:59 ` Eric Blake
2019-04-22 15:03 ` Vladimir Sementsov-Ogievskiy
2019-04-22 15:03 ` 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=0eaf7740-a524-1ef4-27f7-7a0bf0be3222@redhat.com \
--to=eblake@redhat.com \
--cc=den@virtuozzo.com \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--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).