[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/4] block/nbd: correctly use qio_channel_detach_aio_context when
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PATCH 2/4] block/nbd: correctly use qio_channel_detach_aio_context when needed |
Date: |
Thu, 3 Sep 2020 22:02:59 +0300 |
Don't use nbd_client_detach_aio_context() driver handler where we want
to finalize the connection. We should directly use
qio_channel_detach_aio_context() in such cases. Driver handler may (and
will) contain another things, unrelated to the qio channel.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block/nbd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/block/nbd.c b/block/nbd.c
index 912ea27be7..a495ad7ddf 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -549,7 +549,7 @@ static coroutine_fn void nbd_reconnect_attempt(BDRVNBDState
*s)
/* Finalize previous connection if any */
if (s->ioc) {
- nbd_client_detach_aio_context(s->bs);
+ qio_channel_detach_aio_context(QIO_CHANNEL(s->ioc));
object_unref(OBJECT(s->sioc));
s->sioc = NULL;
object_unref(OBJECT(s->ioc));
@@ -707,7 +707,7 @@ static coroutine_fn void nbd_connection_entry(void *opaque)
s->connection_co = NULL;
if (s->ioc) {
- nbd_client_detach_aio_context(s->bs);
+ qio_channel_detach_aio_context(QIO_CHANNEL(s->ioc));
object_unref(OBJECT(s->sioc));
s->sioc = NULL;
object_unref(OBJECT(s->ioc));
--
2.18.0
- [PATCH 0/4] nbd reconnect new fixes, Vladimir Sementsov-Ogievskiy, 2020/09/03
- [PATCH 1/4] block/nbd: fix drain dead-lock because of nbd reconnect-delay, Vladimir Sementsov-Ogievskiy, 2020/09/03
- [PATCH 2/4] block/nbd: correctly use qio_channel_detach_aio_context when needed,
Vladimir Sementsov-Ogievskiy <=
- [PATCH 3/4] block/nbd: fix reconnect-delay, Vladimir Sementsov-Ogievskiy, 2020/09/03
- [PATCH 4/4] block/nbd: nbd_co_reconnect_loop(): don't connect if drained, Vladimir Sementsov-Ogievskiy, 2020/09/03
- Re: [PATCH 0/4] nbd reconnect new fixes, no-reply, 2020/09/04
- Re: [PATCH 0/4] nbd reconnect new fixes, no-reply, 2020/09/04
- Re: [PATCH 0/4] nbd reconnect new fixes, Vladimir Sementsov-Ogievskiy, 2020/09/18