Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-15-SP7:GA
drbd.18466
disconnect-invalid-two-primaries.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File disconnect-invalid-two-primaries.patch of Package drbd.18466
diff -Naur drbd-9.0.14+git.62f906cf.orig/drbd/drbd_receiver.c drbd-9.0.14+git.62f906cf/drbd/drbd_receiver.c --- drbd-9.0.14+git.62f906cf.orig/drbd/drbd_receiver.c 2021-03-25 16:13:54.107048761 +0800 +++ drbd-9.0.14+git.62f906cf/drbd/drbd_receiver.c 2021-03-26 11:00:04.198317636 +0800 @@ -3934,9 +3934,10 @@ struct drbd_connection *connection = peer_device->connection; enum drbd_disk_state disk_state; struct net_conf *nc; - int hg, rule_nr, rr_conflict, always_asbp, peer_node_id = 0, r; + int hg, rule_nr, rr_conflict, always_asbp, peer_node_id = 0, r, pcount; enum drbd_role peer_role = peer_state.role; enum drbd_disk_state peer_disk_state = peer_state.disk; + bool two_primaries; hg = drbd_handshake(peer_device, &rule_nr, &peer_node_id, true); @@ -3967,11 +3968,17 @@ nc = rcu_dereference(connection->transport.net_conf); always_asbp = nc->always_asbp; rr_conflict = nc->rr_conflict; + two_primaries = nc ? nc->two_primaries : false; rcu_read_unlock(); + pcount = (device->resource->role[NOW] == R_PRIMARY) + + (peer_role == R_PRIMARY); + + if (hg == 0 && pcount == 2 && !two_primaries) { + drbd_alert(device, "Dual primaries detected with unified UUID but not allowed, drop connection!\n"); + return -1; + } if (hg == 100 || (hg == -100 && always_asbp)) { - int pcount = (device->resource->role[NOW] == R_PRIMARY) - + (peer_role == R_PRIMARY); int forced = (hg == -100); if (device->resource->res_opts.quorum != QOU_OFF &&
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor