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

Xu Rui rui.xu at easystack.cn
Fri Mar 25 04:02:59 CET 2022


PING
From: Rui Xu <rui.xu at easystack.cn>
Date: 2022-03-02 20:35:23
To:  joel.colledge at linbit.com,philipp.reisner at linbit.com,drbd-dev at lists.linbit.com
Cc:  dongsheng.yang at easystack.cn,Rui Xu <rui.xu at easystack.cn>
Subject: [PATCH] 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!
>
>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