From d9a4672c7a37381b1c50880a2a3440d8cbbb20bd Mon Sep 17 00:00:00 2001
From: yury <yury>
Date: Tue, 18 Nov 2008 10:25:14 +0000
Subject: [PATCH] b=17037 - fixes merge issue in HEAD which caused deadlock on
 ctxt->loc_sem

---
 lustre/obdfilter/filter.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c
index 593f37b0ba..639bfbbb41 100644
--- a/lustre/obdfilter/filter.c
+++ b/lustre/obdfilter/filter.c
@@ -2336,20 +2336,20 @@ static int filter_llog_finish(struct obd_device *obd, int count)
 
         ctxt = llog_group_get_ctxt(&obd->obd_olg, LLOG_MDS_OST_REPL_CTXT);
         if (ctxt) {
+                /*
+                 * Make sure that no cached llcds left in recov_thread.
+                 * We actually do sync in disconnect time, but disconnect
+                 * may not come being marked rq_no_resend = 1.
+                 */
+                llog_sync(ctxt, NULL);
+
+                /*
+                 * Balance class_import_get() in llog_receptor_accept().
+                 * This is safe to do, as llog is already synchronized
+                 * and its import may go.
+                 */
                 mutex_down(&ctxt->loc_sem);
                 if (ctxt->loc_imp) {
-                        /*
-                         * Make sure that no cached llcds left in recov_thread.
-                         * We actually do sync in disconnect time, but disconnect
-                         * may not come being marked rq_no_resend = 1.
-                         */
-                        llog_sync(ctxt, NULL);
-
-                        /*
-                         * Balance class_import_get() in llog_receptor_accept().
-                         * This is safe to do, as llog is already synchronized
-                         * and its import may go.
-                         */
                         class_import_put(ctxt->loc_imp);
                         ctxt->loc_imp = NULL;
                 }
-- 
GitLab