* [Qemu-devel] [PATCH v2] rbd: Fix leaks in rbd_start_aio() error path
@ 2014-06-05 14:19 Kevin Wolf
2014-06-05 14:40 ` Benoît Canet
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Kevin Wolf @ 2014-06-05 14:19 UTC (permalink / raw)
To: qemu-devel; +Cc: kwolf, benoit.canet, stefanha, josh.durgin
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
block/rbd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/block/rbd.c b/block/rbd.c
index 09af484..898fcfe 100644
--- a/block/rbd.c
+++ b/block/rbd.c
@@ -684,13 +684,16 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs,
}
if (r < 0) {
- goto failed;
+ goto failed_completion;
}
return &acb->common;
+failed_completion:
+ rbd_aio_release(c);
failed:
g_free(rcb);
+ qemu_vfree(acb->bounce);
qemu_aio_release(acb);
return NULL;
}
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2] rbd: Fix leaks in rbd_start_aio() error path
2014-06-05 14:19 [Qemu-devel] [PATCH v2] rbd: Fix leaks in rbd_start_aio() error path Kevin Wolf
@ 2014-06-05 14:40 ` Benoît Canet
2014-06-05 22:02 ` Josh Durgin
2014-06-09 13:28 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Benoît Canet @ 2014-06-05 14:40 UTC (permalink / raw)
To: Kevin Wolf; +Cc: benoit.canet, josh.durgin, qemu-devel, stefanha
The Thursday 05 Jun 2014 à 16:19:26 (+0200), Kevin Wolf wrote :
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/rbd.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/block/rbd.c b/block/rbd.c
> index 09af484..898fcfe 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
> @@ -684,13 +684,16 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs,
> }
>
> if (r < 0) {
> - goto failed;
> + goto failed_completion;
> }
>
> return &acb->common;
>
> +failed_completion:
> + rbd_aio_release(c);
> failed:
> g_free(rcb);
> + qemu_vfree(acb->bounce);
> qemu_aio_release(acb);
> return NULL;
> }
> --
> 1.8.3.1
>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2] rbd: Fix leaks in rbd_start_aio() error path
2014-06-05 14:19 [Qemu-devel] [PATCH v2] rbd: Fix leaks in rbd_start_aio() error path Kevin Wolf
2014-06-05 14:40 ` Benoît Canet
@ 2014-06-05 22:02 ` Josh Durgin
2014-06-09 13:28 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Josh Durgin @ 2014-06-05 22:02 UTC (permalink / raw)
To: Kevin Wolf, qemu-devel; +Cc: benoit.canet, stefanha
On 06/05/2014 07:19 AM, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/rbd.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/block/rbd.c b/block/rbd.c
> index 09af484..898fcfe 100644
> --- a/block/rbd.c
> +++ b/block/rbd.c
> @@ -684,13 +684,16 @@ static BlockDriverAIOCB *rbd_start_aio(BlockDriverState *bs,
> }
>
> if (r < 0) {
> - goto failed;
> + goto failed_completion;
> }
>
> return &acb->common;
>
> +failed_completion:
> + rbd_aio_release(c);
> failed:
> g_free(rcb);
> + qemu_vfree(acb->bounce);
> qemu_aio_release(acb);
> return NULL;
> }
>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
FWIW this error path can only happen in certain combinations of odd
circumstances, including specific forms of disk corruption of certain
objects in concert with other factors, so it's quite unlikely to occur
in practice.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH v2] rbd: Fix leaks in rbd_start_aio() error path
2014-06-05 14:19 [Qemu-devel] [PATCH v2] rbd: Fix leaks in rbd_start_aio() error path Kevin Wolf
2014-06-05 14:40 ` Benoît Canet
2014-06-05 22:02 ` Josh Durgin
@ 2014-06-09 13:28 ` Stefan Hajnoczi
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2014-06-09 13:28 UTC (permalink / raw)
To: Kevin Wolf; +Cc: benoit.canet, josh.durgin, qemu-devel, stefanha
[-- Attachment #1: Type: text/plain, Size: 338 bytes --]
On Thu, Jun 05, 2014 at 04:19:26PM +0200, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/rbd.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
(It seems I forgot to reply last week when I merged this.)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-09 13:28 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-05 14:19 [Qemu-devel] [PATCH v2] rbd: Fix leaks in rbd_start_aio() error path Kevin Wolf
2014-06-05 14:40 ` Benoît Canet
2014-06-05 22:02 ` Josh Durgin
2014-06-09 13:28 ` Stefan Hajnoczi
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).