Whamcloud - gitweb
LU-8287 nodemap: don't stop config lock when target stops
[fs/lustre-release.git] / lustre / mgc / mgc_request.c
index 0d568d3..b263c4b 100644 (file)
@@ -485,12 +485,9 @@ static int config_log_end(char *logname, struct config_llog_instance *cfg)
                config_log_put(cld_params);
        }
 
-       if (cld_nodemap) {
-               mutex_lock(&cld_nodemap->cld_lock);
-               cld_nodemap->cld_stopping = 1;
-               mutex_unlock(&cld_nodemap->cld_lock);
+       /* don't set cld_stopping on nm lock as other targets may be active */
+       if (cld_nodemap)
                config_log_put(cld_nodemap);
-       }
 
        /* drop the ref from the find */
        config_log_put(cld);
@@ -553,10 +550,13 @@ static void do_requeue(struct config_llog_data *cld)
 
        LASSERT(atomic_read(&cld->cld_refcount) > 0);
 
-       /* Do not run mgc_process_log on a disconnected export or an
+       /*
+        * Do not run mgc_process_log on a disconnected export or an
         * export which is being disconnected. Take the client
-        * semaphore to make the check non-racy. */
-       down_read(&cld->cld_mgcexp->exp_obd->u.cli.cl_sem);
+        * semaphore to make the check non-racy.
+        */
+       down_read_nested(&cld->cld_mgcexp->exp_obd->u.cli.cl_sem,
+                        OBD_CLI_SEM_MGC);
        if (cld->cld_mgcexp->exp_obd->u.cli.cl_conn_count != 0) {
                CDEBUG(D_MGC, "updating log %s\n", cld->cld_logname);
                rc = mgc_process_log(cld->cld_mgcexp->exp_obd, cld);