[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/20] nbd/client-connection: nbd_co_establish_connection(): fix n
From: |
Eric Blake |
Subject: |
[PULL 14/20] nbd/client-connection: nbd_co_establish_connection(): fix non set errp |
Date: |
Mon, 27 Sep 2021 16:55:39 -0500 |
From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
When we don't have a connection and blocking is false, we return NULL
but don't set errp. That's wrong.
We have two paths for calling nbd_co_establish_connection():
1. nbd_open() -> nbd_do_establish_connection() -> ...
but that will never set blocking=false
2. nbd_reconnect_attempt() -> nbd_co_do_establish_connection() -> ...
but that uses errp=NULL
So, we are safe with our wrong errp policy in
nbd_co_establish_connection(). Still let's fix it.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20210906190654.183421-2-vsementsov@virtuozzo.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
nbd/client-connection.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/nbd/client-connection.c b/nbd/client-connection.c
index 7123b1e18900..695f85575414 100644
--- a/nbd/client-connection.c
+++ b/nbd/client-connection.c
@@ -318,6 +318,7 @@ nbd_co_establish_connection(NBDClientConnection *conn,
NBDExportInfo *info,
}
if (!blocking) {
+ error_setg(errp, "No connection at the moment");
return NULL;
}
--
2.31.1
- [PULL 11/20] block: use int64_t instead of int in driver discard handlers, (continued)
- [PULL 11/20] block: use int64_t instead of int in driver discard handlers, Eric Blake, 2021/09/27
- [PULL 04/20] block: use int64_t instead of uint64_t in driver read handlers, Eric Blake, 2021/09/27
- [PULL 07/20] block: make BlockLimits::max_pwrite_zeroes 64bit, Eric Blake, 2021/09/27
- [PULL 09/20] block/io: allow 64bit write-zeroes requests, Eric Blake, 2021/09/27
- [PULL 12/20] block/io: allow 64bit discard requests, Eric Blake, 2021/09/27
- [PULL 13/20] nbd/server: Allow LIST_META_CONTEXT without STRUCTURED_REPLY, Eric Blake, 2021/09/27
- [PULL 15/20] block/nbd: nbd_channel_error() shutdown channel unconditionally, Eric Blake, 2021/09/27
- [PULL 18/20] block/nbd: drop connection_co, Eric Blake, 2021/09/27
- [PULL 17/20] block/nbd: refactor nbd_recv_coroutines_wake_all(), Eric Blake, 2021/09/27
- [PULL 08/20] block: use int64_t instead of int in driver write_zeroes handlers, Eric Blake, 2021/09/27
- [PULL 14/20] nbd/client-connection: nbd_co_establish_connection(): fix non set errp,
Eric Blake <=
- [PULL 16/20] block/nbd: move nbd_recv_coroutines_wake_all() up, Eric Blake, 2021/09/27
- [PULL 19/20] block/nbd: check that received handle is valid, Eric Blake, 2021/09/27
- [PULL 20/20] nbd/server: Add --selinux-label option, Eric Blake, 2021/09/27
- Re: [PULL 00/20] NBD patches through 2021-09-27, Peter Maydell, 2021/09/29
- Re: [PULL 00/20] NBD patches through 2021-09-27, Paolo Bonzini, 2021/09/29
- Re: [PULL 00/20] NBD patches through 2021-09-27, Richard Henderson, 2021/09/29
- Re: [PULL 00/20] NBD patches through 2021-09-27, Paolo Bonzini, 2021/09/29
- Re: [PULL 00/20] NBD patches through 2021-09-27, Eric Blake, 2021/09/29
- Re: [PULL 00/20] NBD patches through 2021-09-27, Richard W.M. Jones, 2021/09/29
- Re: [PULL 00/20] NBD patches through 2021-09-27, Daniel P . Berrangé, 2021/09/30