[Ocfs2-commits] smushran commits r2880 - branches/ocfs2-1.2/fs/ocfs2/dlm

svn-commits@oss.oracle.com svn-commits at oss.oracle.com
Wed Apr 19 20:32:37 CDT 2006


Author: smushran
Signed-off-by: mfasheh
Signed-off-by: khackel
Date: 2006-04-19 20:32:36 -0500 (Wed, 19 Apr 2006)
New Revision: 2880

Modified:
   branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c
Log:
lvb recovery fix
Signed-off-by: mfasheh
Signed-off-by: khackel

Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c	2006-04-20 01:16:03 UTC (rev 2879)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c	2006-04-20 01:32:36 UTC (rev 2880)
@@ -1673,41 +1673,49 @@
 		}
 		lksb->flags |= (ml->flags &
 				(DLM_LKSB_PUT_LVB|DLM_LKSB_GET_LVB));
-			
+
+		if (ml->type == LKM_NLMODE)
+			goto skip_lvb;
+
 		if (!dlm_lvb_is_empty(mres->lvb)) {
 			if (lksb->flags & DLM_LKSB_PUT_LVB) {
 				/* other node was trying to update
 				 * lvb when node died.  recreate the
 				 * lksb with the updated lvb. */
 				memcpy(lksb->lvb, mres->lvb, DLM_LVB_LEN);
+				/* the lock resource lvb update must happen
+				 * NOW, before the spinlock is dropped.
+				 * we no longer wait for the AST to update
+				 * the lvb. */
+				memcpy(res->lvb, mres->lvb, DLM_LVB_LEN);
 			} else {
 				/* otherwise, the node is sending its 
 				 * most recent valid lvb info */
 				BUG_ON(ml->type != LKM_EXMODE &&
 				       ml->type != LKM_PRMODE);
 				if (!dlm_lvb_is_empty(res->lvb) &&
-				    (ml->type == LKM_EXMODE ||
-				     memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) {
-					int i;
-					mlog(ML_ERROR, "%s:%.*s: received bad "
-					     "lvb! type=%d\n", dlm->name,
-					     res->lockname.len,
-					     res->lockname.name, ml->type);
-					printk("lockres lvb=[");
-					for (i=0; i<DLM_LVB_LEN; i++)
-						printk("%02x", res->lvb[i]);
-					printk("]\nmigrated lvb=[");
-					for (i=0; i<DLM_LVB_LEN; i++)
-						printk("%02x", mres->lvb[i]);
-					printk("]\n");
-					dlm_print_one_lock_resource(res);
-					BUG();
+ 				    (ml->type == LKM_EXMODE ||
+ 				     memcmp(res->lvb, mres->lvb, DLM_LVB_LEN))) {
+ 					int i;
+ 					mlog(ML_ERROR, "%s:%.*s: received bad "
+ 					     "lvb! type=%d\n", dlm->name,
+ 					     res->lockname.len,
+ 					     res->lockname.name, ml->type);
+ 					printk("lockres lvb=[");
+ 					for (i=0; i<DLM_LVB_LEN; i++)
+ 						printk("%02x", res->lvb[i]);
+ 					printk("]\nmigrated lvb=[");
+ 					for (i=0; i<DLM_LVB_LEN; i++)
+ 						printk("%02x", mres->lvb[i]);
+ 					printk("]\n");
+ 					dlm_print_one_lock_resource(res);
+ 					BUG();
 				}
 				memcpy(res->lvb, mres->lvb, DLM_LVB_LEN);
 			}
 		}
+skip_lvb:
 
-
 		/* NOTE:
 		 * wrt lock queue ordering and recovery:
 		 *    1. order of locks on granted queue is




More information about the Ocfs2-commits mailing list