commit b775310ecb7549122d6e39b88c84b48ea65a5dc5 Author: Philipp Reisner Date: Sat Jan 23 23:49:13 2016 +0100 drbd: Do not outdate myself if I am primary diff --git a/drbd/drbd_state.c b/drbd/drbd_state.c index ee63141..8a3ca9f 100644 --- a/drbd/drbd_state.c +++ b/drbd/drbd_state.c @@ -3574,6 +3574,9 @@ void __outdate_myself(struct drbd_resource *resource) struct drbd_device *device; int vnr; + if (resource->role[NOW] == R_PRIMARY) + return; + idr_for_each_entry(&resource->devices, device, vnr) { if (device->disk_state[NOW] > D_OUTDATED) __change_disk_state(device, D_OUTDATED); commit c6963c44c48c99e7248265ee4318914e69b4a6fd Author: Philipp Reisner Date: Sat Jan 23 22:56:06 2016 +0100 drbd: When connect fails because too many primaries assume split-brain If there are more primaries than allowed, and connect fails therefore we do not get a chance to look at the UUIDs. In order to match expectations (and drbd-8 behaviour) call the split-brain handler in this case as well. diff --git a/drbd/drbd_receiver.c b/drbd/drbd_receiver.c index 904d444..bd59827 100644 --- a/drbd/drbd_receiver.c +++ b/drbd/drbd_receiver.c @@ -667,6 +667,10 @@ int connect_work(struct drbd_work *work, int cancel) connection->connect_timer.expires = jiffies + HZ/20; add_timer(&connection->connect_timer); return 0; /* Return early. Keep the reference on the connection! */ + } else if (rv == SS_TWO_PRIMARIES) { + change_cstate(connection, C_DISCONNECTING, CS_HARD); + drbd_alert(connection, "Split-Brain since more primaries than allowed; dropping connection!\n"); + drbd_khelper(NULL, connection, "split-brain"); } else { drbd_info(connection, "Failure to connect; retrying\n"); change_cstate(connection, C_NETWORK_FAILURE, CS_HARD);