Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
* [Drbd-dev] [PATCH] drbd: fix a bug with two-primaries configuration
@ 2022-07-28 11:47 Rui Xu
  2022-08-01 14:22 ` Joel Colledge
  0 siblings, 1 reply; 3+ messages in thread
From: Rui Xu @ 2022-07-28 11:47 UTC (permalink / raw)
  To: philipp.reisner, drbd-dev, joel.colledge; +Cc: Rui Xu, dongsheng.yang

There is a bug when execute 'drbdsetup disconnect' in
two-primaries configuration.

When 'drbdsetup disconnect' is called by user, two primary
nodes will going to outdated in do_change_cstate, then the
command will failed since there is no UpToDate node.

Fix it by modify the judgment condition in do_change_cstate.

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

diff --git a/drbd/drbd_state.c b/drbd/drbd_state.c
index 792a96d5..c4f3f776 100644
--- a/drbd/drbd_state.c
+++ b/drbd/drbd_state.c
@@ -5406,7 +5406,7 @@ static bool do_change_cstate(struct change_context *context, enum change_phase p
 		u64 directly_reachable = directly_connected_nodes(resource, NEW) |
 			NODE_MASK(resource->res_opts.node_id);
 
-		if (reply->primary_nodes & ~directly_reachable)
+		if (!(reply->primary_nodes & directly_reachable))
 			__outdate_myself(resource);
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-08-02  2:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-28 11:47 [Drbd-dev] [PATCH] drbd: fix a bug with two-primaries configuration Rui Xu
2022-08-01 14:22 ` Joel Colledge
2022-08-02  2:35   ` rui.xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox