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);
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);