mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 16:49:39 -05:00
During cleanup always unlock root_mutex if rootlock is true
(don't make it conditional on p == NULL)
This commit is contained in:
parent
695ad44694
commit
6edeeeffd4
4 changed files with 10 additions and 9 deletions
|
|
@ -119,8 +119,8 @@ ldbm_back_add(
|
|||
* and release the add lock.
|
||||
*/
|
||||
pthread_mutex_lock(&li->li_root_mutex);
|
||||
rootlock = 1;
|
||||
pthread_mutex_unlock(&li->li_add_mutex);
|
||||
rootlock=1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -134,7 +134,8 @@ ldbm_back_add(
|
|||
if( p != NULL) {
|
||||
/* free parent and writer lock */
|
||||
cache_return_entry_w( &li->li_cache, p );
|
||||
} else if ( rootlock ) {
|
||||
}
|
||||
if ( rootlock ) {
|
||||
/* release root lock */
|
||||
pthread_mutex_unlock(&li->li_root_mutex);
|
||||
}
|
||||
|
|
@ -208,8 +209,9 @@ return_results:;
|
|||
if (p != NULL) {
|
||||
/* free parent and writer lock */
|
||||
cache_return_entry_w( &li->li_cache, p );
|
||||
}
|
||||
|
||||
} else if ( rootlock ) {
|
||||
if ( rootlock ) {
|
||||
/* release root lock */
|
||||
pthread_mutex_unlock(&li->li_root_mutex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,8 +141,9 @@ return_results:;
|
|||
if( p != NULL ) {
|
||||
/* free parent and writer lock */
|
||||
cache_return_entry_w( &li->li_cache, p );
|
||||
}
|
||||
|
||||
} else if ( rootlock ) {
|
||||
if ( rootlock ) {
|
||||
/* release root lock */
|
||||
pthread_mutex_unlock(&li->li_root_mutex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ ldbm_back_modify(
|
|||
|
||||
Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0);
|
||||
|
||||
/* acquire and lock entry */
|
||||
if ( (e = dn2entry_w( be, dn, &matched )) == NULL ) {
|
||||
send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT, matched,
|
||||
NULL );
|
||||
|
|
@ -41,10 +42,6 @@ ldbm_back_modify(
|
|||
return( -1 );
|
||||
}
|
||||
|
||||
/* check for deleted */
|
||||
|
||||
/* lock entry */
|
||||
|
||||
if ( (err = acl_check_modlist( be, conn, op, e, modlist )) != LDAP_SUCCESS ) {
|
||||
send_ldap_result( conn, op, err, NULL, NULL );
|
||||
goto error_return;
|
||||
|
|
|
|||
|
|
@ -176,8 +176,9 @@ return_results:
|
|||
if( p != NULL ) {
|
||||
/* free parent and writer lock */
|
||||
cache_return_entry_w( &li->li_cache, p );
|
||||
}
|
||||
|
||||
} else if ( rootlock ) {
|
||||
if ( rootlock ) {
|
||||
/* release root writer lock */
|
||||
pthread_mutex_unlock(&li->li_root_mutex);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue