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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Oct 27 17:53:59 CDT 2005


Author: khackel
Signed-off-by: mfasheh
Date: 2005-10-27 17:53:58 -0500 (Thu, 27 Oct 2005)
New Revision: 2664

Modified:
   branches/ocfs2-1.2/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.2/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c	2005-10-27 22:41:42 UTC (rev 2663)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c	2005-10-27 22:53:58 UTC (rev 2664)
@@ -1230,6 +1230,7 @@
 	char *name;
 	unsigned int namelen;
 	int found, ret;
+	int set_maybe;
 
 	if (!dlm_grab(dlm))
 		return DLM_MASTER_RESP_NO;
@@ -1315,6 +1316,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 "
@@ -1333,12 +1335,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);
@@ -1387,6 +1396,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;
@@ -1400,9 +1410,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