[Ocfs2-commits] khackel commits r2754 - branches/ocfs2-1.2/fs/ocfs2/dlm

svn-commits@oss.oracle.com svn-commits at oss.oracle.com
Wed Jan 18 19:06:58 CST 2006


Author: khackel
Signed-off-by: khackel
Signed-off-by: mfasheh
Date: 2006-01-18 19:06:53 -0600 (Wed, 18 Jan 2006)
New Revision: 2754

Modified:
   branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c
Log:
* after successfully taking the $RECOVERY lock in EX mode, recheck to make sure
  that recovery has not already begun or completed on another node

Signed-off-by: khackel
Signed-off-by: mfasheh



Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c	2006-01-19 01:06:16 UTC (rev 2753)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c	2006-01-19 01:06:53 UTC (rev 2754)
@@ -2065,8 +2065,32 @@
 			     dlm->reco.new_master);
 			status = -EEXIST;
 		} else {
+			status = 0;
+
+			/* see if recovery was already finished elsewhere */
+			spin_lock(&dlm->spinlock);
+			if (dlm->reco.dead_node == O2NM_INVALID_NODE_NUM) {
+				status = -EINVAL;	
+				mlog(0, "%s: got reco EX lock, but "
+				     "node got recovered already\n", dlm->name);
+				if (dlm->reco.new_master != O2NM_INVALID_NODE_NUM) {
+					mlog(ML_ERROR, "%s: new master is %u "
+					     "but no dead node!\n", 
+					     dlm->name, dlm->reco.new_master);
+					BUG();
+				}
+			}
+			spin_unlock(&dlm->spinlock);
+		}
+
+		/* if this node has actually become the recovery master,
+		 * set the master and send the messages to begin recovery */
+		if (!status) {
+			mlog(0, "%s: dead=%u, this=%u, sending "
+			     "begin_reco now\n", dlm->name, 
+			     dlm->reco.dead_node, dlm->node_num);
 			status = dlm_send_begin_reco_message(dlm,
-				      dlm->reco.dead_node);
+			      dlm->reco.dead_node);
 			/* this always succeeds */
 			BUG_ON(status);
 



More information about the Ocfs2-commits mailing list