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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri May 2 14:22:01 PDT 2008


Author: smushran
Date: 2008-05-02 14:22:01 -0700 (Fri, 02 May 2008)
New Revision: 3088

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

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

dlm_master_request_handler() forgot to put a lockres when
dlm_assert_master_worker() failed or was skipped.

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:21:13 UTC (rev 3087)
+++ branches/ocfs2-1.2/fs/ocfs2/dlm/dlmmaster.c	2008-05-02 21:22:01 UTC (rev 3088)
@@ -1671,7 +1671,12 @@
 		dlm_put_mle(tmpmle);
 	}
 send_response:
-
+	/*
+	 * __dlm_lookup_lockres() grabbed a reference to this lockres.
+	 * The reference is released by dlm_assert_master_worker() under
+	 * the call to dlm_dispatch_assert_master().  If
+	 * dlm_assert_master_worker() isn't called, we drop it here.
+	 */
 	if (dispatch_assert) {
 		if (response != DLM_MASTER_RESP_YES)
 			mlog(ML_ERROR, "invalid response %d\n", response);
@@ -1686,7 +1691,11 @@
 		if (ret < 0) {
 			mlog(ML_ERROR, "failed to dispatch assert master work\n");
 			response = DLM_MASTER_RESP_ERROR;
+			dlm_lockres_put(res);
 		}
+	} else {
+		if (res)
+			dlm_lockres_put(res);
 	}
 
 	dlm_put(dlm);




More information about the Ocfs2-commits mailing list