Skip to content
Snippets Groups Projects
Commit 6edeeeff authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

During cleanup always unlock root_mutex if rootlock is true

(don't make it conditional on p == NULL)
parent 695ad446
No related branches found
No related tags found
No related merge requests found
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment