[Ocfs2-commits] khackel commits r2663 - branches/ocfs2-1.0/fs/ocfs2/dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Oct 27 17:41:43 CDT 2005


Author: khackel
Signed-off-by: mfasheh
Date: 2005-10-27 17:41:42 -0500 (Thu, 27 Oct 2005)
New Revision: 2663

Modified:
   branches/ocfs2-1.0/fs/ocfs2/dlm/dlmmaster.c
Log:
* merge r2662 from trunk
	- fixes bug 569: Node crashed with dlm_do_assert_master:1394

Signed-off-by: mfasheh



Modified: branches/ocfs2-1.0/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- branches/ocfs2-1.0/fs/ocfs2/dlm/dlmmaster.c	2005-10-27 22:33:42 UTC (rev 2662)
+++ branches/ocfs2-1.0/fs/ocfs2/dlm/dlmmaster.c	2005-10-27 22:41:42 UTC (rev 2663)
@@ -1159,6 +1159,7 @@
 	char *name;
 	unsigned int namelen;
 	int found, ret;
+	int set_maybe;
 
 	if (!dlm_grab(dlm))
 		return DLM_MASTER_RESP_NO;
@@ -1245,6 +1246,7 @@
 			mlog(ML_ERROR, "no mle found for this lock!\n");
 			BUG();
 		}
+		set_maybe = 1;
 		spin_lock(&tmpmle->spinlock);
 		if (tmpmle->type == DLM_MLE_BLOCK) {
 			// mlog(0, "this node is waiting for "
@@ -1263,12 +1265,19 @@
 				/* the real master can respond on its own */
 				response = DLM_MASTER_RESP_NO;
 			}
+		} else if (tmpmle->master != DLM_LOCK_RES_OWNER_UNKNOWN) {
+			set_maybe = 0;
+			if (tmpmle->master == dlm->node_num)
+				response = DLM_MASTER_RESP_YES;
+			else
+				response = DLM_MASTER_RESP_NO;
 		} else {
 			// mlog(0, "this node is attempting to "
 			// "master lockres\n");
 			response = DLM_MASTER_RESP_MAYBE;
 		}
-		set_bit(request->node_idx, tmpmle->maybe_map);
+		if (set_maybe)
+			set_bit(request->node_idx, tmpmle->maybe_map);
 		spin_unlock(&tmpmle->spinlock);
 
 		spin_unlock(&dlm->master_lock);
@@ -1317,6 +1326,7 @@
 		response = DLM_MASTER_RESP_NO;
 	} else {
 		// mlog(0, "mle was found\n");
+		set_maybe = 1;
 		spin_lock(&tmpmle->spinlock);
 		if (tmpmle->type == DLM_MLE_BLOCK)
 			response = DLM_MASTER_RESP_NO;
@@ -1330,9 +1340,15 @@
 			}
 			/* real master can respond on its own */
 			response = DLM_MASTER_RESP_NO;
-		} else
-			response = DLM_MASTER_RESP_MAYBE;
-		set_bit(request->node_idx, tmpmle->maybe_map);
+		} else {
+			if (tmpmle->master == dlm->node_num) {
+				response = DLM_MASTER_RESP_YES;
+				set_maybe = 0;
+			} else
+				response = DLM_MASTER_RESP_MAYBE;
+		}
+		if (set_maybe)
+			set_bit(request->node_idx, tmpmle->maybe_map);
 		spin_unlock(&tmpmle->spinlock);
 	}
 	spin_unlock(&dlm->master_lock);



More information about the Ocfs2-commits mailing list