drbd:do not wait for negotiation result with unconnected peer
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
@@ -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
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_NEGOTIATINGif 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 <[email protected]>---
drbd/drbd_state.c| 3 ++-1 file changed, 2 insertions(+), 1 deletion(-)drbd/drbd_state.c +2
-1@@ -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
Hi Rui Xu,
Sorry for the slow responses. We do appreciate the contributions and will review them.
Joel
Thanks for this patch! It has been applied in a slightly simplified form as:
https://github.com/LINBIT/drbd/commit/aea83b266ba9a3c46ea773a12f57b2fb6dff15a4
Joel