[Drbd-dev] [PATCH] drbd:do not wait for negotiation result with unconnected peer

Rui Xu rui.xu at easystack.cn
Wed Mar 2 13:35:23 CET 2022


The commit 8a962a6a from Dec 2014
"drbd: fix leaving of D_NEGOTIATING if some peer do not have the minor yet"
introduced a bug that disk state will always stay in negotiating since there
will never be negotiation result with unconnected peer.

So do not wait for an negotiation result with unconnected peer!

Signed-off-by: Rui Xu <rui.xu at easystack.cn>
---
 drbd/drbd_state.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drbd/drbd_state.c b/drbd/drbd_state.c
index aeaf36a..f79f5a4 100644
--- a/drbd/drbd_state.c
+++ b/drbd/drbd_state.c
@@ -1912,7 +1912,8 @@ static void sanitize_state(struct drbd_resource *resource)
 				enum drbd_repl_state nr = peer_device->negotiation_result;
 				enum drbd_disk_state pdsk = peer_device->disk_state[NEW];
 
-				if (pdsk == D_UNKNOWN || pdsk < D_NEGOTIATING)
+				if (pdsk == D_UNKNOWN || pdsk < D_NEGOTIATING ||
+				    peer_device->connection->cstate[NEW] < C_CONNECTED)
 					continue;
 
 				if (pdsk == D_UP_TO_DATE)
-- 
1.8.3.1



More information about the drbd-dev mailing list