[DRBD-cvs] svn commit by phil - r2793 - trunk/drbd - Since we have
now the "rr-conflict" configure option, t
drbd-cvs at lists.linbit.com
drbd-cvs at lists.linbit.com
Mon Mar 12 18:47:42 CET 2007
Author: phil
Date: 2007-03-12 18:47:41 +0100 (Mon, 12 Mar 2007)
New Revision: 2793
Modified:
trunk/drbd/drbd_receiver.c
Log:
Since we have now the "rr-conflict" configure option, the
evaluation of "is a disk inconsistent" should happen before
we even look at the UUIDs.
Modified: trunk/drbd/drbd_receiver.c
===================================================================
--- trunk/drbd/drbd_receiver.c 2007-03-12 14:12:32 UTC (rev 2792)
+++ trunk/drbd/drbd_receiver.c 2007-03-12 17:47:41 UTC (rev 2793)
@@ -1932,20 +1932,24 @@
STATIC drbd_conns_t drbd_sync_handshake(drbd_dev *mdev, drbd_role_t peer_role,
drbd_disks_t peer_disk)
{
- int hg,rule_nr;
+ int hg,rule_nr=0;
drbd_conns_t rv = conn_mask;
drbd_disks_t mydisk;
mydisk = mdev->state.disk;
if( mydisk == Negotiating ) mydisk = mdev->new_state_tmp.disk;
- hg = drbd_uuid_compare(mdev,&rule_nr);
+ // Look if a disk is inconsistent. Only if this does not find
+ // a decission look at the UUIDs.
+ if(mydisk==Inconsistent && peer_disk>Inconsistent) hg=-1;
+ else if(mydisk>Inconsistent && peer_disk==Inconsistent) hg= 1;
+ else hg = drbd_uuid_compare(mdev,&rule_nr);
MTRACE(TraceTypeUuid,TraceLvlSummary,
INFO("drbd_sync_handshake:\n");
drbd_uuid_dump(mdev,"self",mdev->bc->md.uuid);
drbd_uuid_dump(mdev,"peer",mdev->p_uuid);
- INFO("uuid_compare()=%d by rule %d\n",hg,rule_nr);
+ INFO("have_good=%d by rule %d\n",hg,rule_nr);
);
if (hg == 100 || (hg == -100 && mdev->net_conf->always_asbp) ) {
@@ -1990,13 +1994,6 @@
}
}
- if (abs(hg) < 100) {
- // This is needed in case someone does an invalidate on an
- // disconnected node. This has priority.
- if(mydisk==Inconsistent && peer_disk>Inconsistent) hg=-1;
- if(mydisk>Inconsistent && peer_disk==Inconsistent) hg= 1;
- }
-
if (hg == -1000) {
ALERT("Unrelated data, dropping connection!\n");
drbd_force_state(mdev,NS(conn,Disconnecting));
More information about the drbd-cvs
mailing list