[Ocfs2-commits] seeda commits r3059 - branches/ocfs2-1.2/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Sep 5 16:02:01 PDT 2007


Author: seeda
Date: 2007-09-05 16:01:59 -0700 (Wed, 05 Sep 2007)
New Revision: 3059

Modified:
   branches/ocfs2-1.2/fs/ocfs2/dlmglue.c
Log:
ocfs2: patch to free fcbs in ocfs2_cluster_lock.

ocfs_cluster_lock allocates fcb(ocfs2_lockres_flag_callback) when
callers pass in a callback. It queues the fcb if there is a
potential wait for the lock. And the fcb gets freed after firing
the callback. But if there is no need to queue the callback then
the fcb gets freed only if there is an error but doesn't get freed
if the lock is compatible. One such condition is if ocfs2_cluster_lock
is called from ocfs2_file_aio_read for a PR request and the PR
is already allocated.

Signed-off-By: smushran



Modified: branches/ocfs2-1.2/fs/ocfs2/dlmglue.c
===================================================================
--- branches/ocfs2-1.2/fs/ocfs2/dlmglue.c	2007-08-31 17:33:35 UTC (rev 3058)
+++ branches/ocfs2-1.2/fs/ocfs2/dlmglue.c	2007-09-05 23:01:59 UTC (rev 3059)
@@ -1036,8 +1036,8 @@
 		mlog_errno(ret);
 	}
 
-	/* Only free the async fcb on error. */
-	if (ret && ret != -EIOCBRETRY && !sync) {
+	/* free the async fcb on error or if it is not queued. */
+	if ((ret && ret != -EIOCBRETRY && !sync) || (!ret && !sync)) {
 		mlog_bug_on_msg(!list_empty(&fcb->fc_lockres_item),
 				"Lockres %s, freeing flag callback in use\n",
 				lockres->l_name);




More information about the Ocfs2-commits mailing list