39 lines
1.3 KiB
Diff
39 lines
1.3 KiB
Diff
|
From f31e31b32e662d0aadb77bc639308c8a65968886 Mon Sep 17 00:00:00 2001
|
||
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
||
|
Date: Tue, 23 Jul 2024 17:26:39 +0100
|
||
|
Subject: [PATCH] lib: Don't overwrite error in nbd_opt_{go,info}
|
||
|
|
||
|
We already set the error in handle_reply_error, so don't overwrite
|
||
|
that here.
|
||
|
|
||
|
(cherry picked from commit 474a4ae6c8d11212a4a8c06ea3e8b3fd97a7e97d)
|
||
|
---
|
||
|
lib/opt.c | 4 ++--
|
||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||
|
|
||
|
diff --git a/lib/opt.c b/lib/opt.c
|
||
|
index 600265a0..5872dd54 100644
|
||
|
--- a/lib/opt.c
|
||
|
+++ b/lib/opt.c
|
||
|
@@ -99,7 +99,7 @@ nbd_unlocked_opt_go (struct nbd_handle *h)
|
||
|
if (r == 0 && err) {
|
||
|
assert (nbd_internal_is_state_negotiating (get_next_state (h)) ||
|
||
|
nbd_internal_is_state_dead (get_next_state (h)));
|
||
|
- set_error (err, "server replied with error to opt_go request");
|
||
|
+ /* handle_reply_error already called set_error */
|
||
|
return -1;
|
||
|
}
|
||
|
if (r == 0)
|
||
|
@@ -122,7 +122,7 @@ nbd_unlocked_opt_info (struct nbd_handle *h)
|
||
|
if (r == 0 && err) {
|
||
|
assert (nbd_internal_is_state_negotiating (get_next_state (h)) ||
|
||
|
nbd_internal_is_state_dead (get_next_state (h)));
|
||
|
- set_error (err, "server replied with error to opt_info request");
|
||
|
+ /* handle_reply_error already called set_error */
|
||
|
return -1;
|
||
|
}
|
||
|
return r;
|
||
|
--
|
||
|
2.43.0
|
||
|
|