Skip to contentSkip to conversation

drbd:do not wait for negotiation result with unconnected peer

PATCH In review Rui Xu 2 participants 4 messages Mar 2, 2022 – Apr 8, 2022 DRBD driver

lore
Share & tools
lore

Rui Xu

author
#0 lore raw

PATCH 1/1 drbd:do not wait for negotiation result with unconnected peer

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!

---
 drbd/drbd_state.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drbd/drbd_state.c +2 -1
index aeaf36a..f79f5a4 100644
@@ -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)
Signature · 1 line
1.8.3.1
author
#1 lore raw

PING
From: Rui Xu <[email protected]>
Date: 2022-03-02 20:35:23
To: [email protected],[email protected],[email protected]
Cc: [email protected],Rui Xu <[email protected]>
Subject: [PATCH] drbd:do not wait for negotiation result with unconnected peer>The commit 8a962a6a from Dec 2014

Quoted 28 lines

"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!

---
drbd/drbd_state.c | 3 ++-

1 file changed, 2 insertions(+), 1 deletion(-)
drbd/drbd_state.c +2 -1
index aeaf36a..f79f5a4 100644
@@ -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)
Signature · 1 line
1.8.3.1
#2 lore raw

Hi Rui Xu,

Sorry for the slow responses. We do appreciate the contributions and will review them.

Joel