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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri May 2 14:20:00 PDT 2008


Author: smushran
Date: 2008-05-02 14:20:00 -0700 (Fri, 02 May 2008)
New Revision: 3086

Modified:
   branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c
   branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c
Log:
ocfs2/dlm: Add missing dlm_lock_put()s

Mainline commit 2c5c54aca9d0263f81bd4886232835ba31f7635a
Author: Sunil Mushran <sunil.mushran at oracle.com>
Date: Sat, 1 Mar 2008 14:04:20 -0800

Normally locks for remote nodes are freed when that node sends an UNLOCK
message to the master. The master node tags an DLM_UNLOCK_FREE_LOCK action
to do an extra put on the lock at the end.

However, there are times when the master node has to free the locks for the
remote nodes forcibly.

Two cases when this happens are:
1. When the master has migrated the lockres plus all locks to another node.
2. When the master is clearing all the locks of a dead node.

It was in the above two conditions that the dlm was missing the extra put.

Signed-off-by: jlbec

Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c	2008-05-02 21:18:08 UTC (rev 3085)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c	2008-05-02 21:20:00 UTC (rev 3086)
@@ -2940,6 +2940,9 @@
 				dlm_lockres_clear_refmap_bit(lock->ml.node, res);
 				list_del_init(&lock->list);
 				dlm_lock_put(lock);
+				/* In a normal unlock, we would have added a
+				 * DLM_UNLOCK_FREE_LOCK action. Force it. */
+				dlm_lock_put(lock);
 			}
 		}
 		queue++;

Modified: branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c	2008-05-02 21:18:08 UTC (rev 3085)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmrecovery.c	2008-05-02 21:20:00 UTC (rev 3086)
@@ -2145,12 +2145,17 @@
 	assert_spin_locked(&dlm->spinlock);
 	assert_spin_locked(&res->spinlock);
 
+	/* We do two dlm_lock_put(). One for removing from list and the other is
+	 * to force the DLM_UNLOCK_FREE_LOCK action so as to free the locks */
+
 	/* TODO: check pending_asts, pending_basts here */
 	list_for_each_safe(iter, tmpiter, &res->granted) {
 		lock = list_entry (iter, struct dlm_lock, list);
 		if (lock->ml.node == dead_node) {
 			list_del_init(&lock->list);
 			dlm_lock_put(lock);
+			/* Can't schedule DLM_UNLOCK_FREE_LOCK - do manually */
+			dlm_lock_put(lock);
 			freed++;
 		}
 	}
@@ -2159,6 +2164,8 @@
 		if (lock->ml.node == dead_node) {
 			list_del_init(&lock->list);
 			dlm_lock_put(lock);
+			/* Can't schedule DLM_UNLOCK_FREE_LOCK - do manually */
+			dlm_lock_put(lock);
 			freed++;
 		}
 	}
@@ -2167,6 +2174,8 @@
 		if (lock->ml.node == dead_node) {
 			list_del_init(&lock->list);
 			dlm_lock_put(lock);
+			/* Can't schedule DLM_UNLOCK_FREE_LOCK - do manually */
+			dlm_lock_put(lock);
 			freed++;
 		}
 	}




More information about the Ocfs2-commits mailing list