[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/4] block/nbd: nbd_co_reconnect_loop(): don't connect if dra
From: |
Eric Blake |
Subject: |
Re: [PATCH 4/4] block/nbd: nbd_co_reconnect_loop(): don't connect if drained |
Date: |
Wed, 23 Sep 2020 10:16:38 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 9/3/20 2:03 PM, Vladimir Sementsov-Ogievskiy wrote:
In a recent commit 12c75e20a269ac we've improved
nbd_co_reconnect_loop() to not make drain wait for additional sleep.
Similarly, we shouldn't try to connect, if previous sleep was
interrupted by drain begin, otherwise drain_begin will have to wait for
the whole connection attempt.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block/nbd.c | 3 +++
1 file changed, 3 insertions(+)
Reviewed-by: Eric Blake <eblake@redhat.com>
diff --git a/block/nbd.c b/block/nbd.c
index caae0e6d31..4548046cd7 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -661,6 +661,9 @@ static coroutine_fn void nbd_co_reconnect_loop(BDRVNBDState
*s)
} else {
qemu_co_sleep_ns_wakeable(QEMU_CLOCK_REALTIME, timeout,
&s->connection_co_sleep_ns_state);
+ if (s->drained) {
+ continue;
+ }
if (timeout < max_timeout) {
timeout *= 2;
}
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
- [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, 2020/09/03
- [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 4/4] block/nbd: nbd_co_reconnect_loop(): don't connect if drained,
Eric Blake <=
- 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