소스 검색

Bug 711679 - unresponsive LDAP service when deleting vlv on replica

https://bugzilla.redhat.com/show_bug.cgi?id=711679

Description: Normal operation acquires rlock on be_lock, then locks
inst_config_mutex.  Function instance_set_busy_and_readonly used to
lock them in the opposite order, which caused the server deadlock.
This patch fixes it by releasing inst_config_mutex before acquiring
wlock on be_lock in slapi_mtn_be_set_readonly.
Noriko Hosoi 14 년 전
부모
커밋
b554264e6b
1개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 6 1
      ldap/servers/slapd/back-ldbm/misc.c

+ 6 - 1
ldap/servers/slapd/back-ldbm/misc.c

@@ -199,9 +199,14 @@ int instance_set_busy_and_readonly(ldbm_instance *inst)
     } else {
         inst->inst_flags &= ~INST_FLAG_READONLY;
     }
+    /* 
+     * Normally, acquire rlock on be_lock, then lock inst_config_mutex.
+     * instance_set_busy_and_readonly should release inst_config_mutex
+     * before acquiring wlock on be_lock in slapi_mtn_be_set_readonly.
+     */
+    PR_Unlock(inst->inst_config_mutex);
     slapi_mtn_be_set_readonly(inst->inst_be, 1);
 
-    PR_Unlock(inst->inst_config_mutex);
     return 0;
 }