From: Kurt Zeilenga Date: Thu, 21 Jan 1999 22:20:03 +0000 (+0000) Subject: During cleanup always unlock root_mutex if rootlock is true X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~725 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6edeeeffd491b98e5740767b657793c89ec048d1;p=openldap During cleanup always unlock root_mutex if rootlock is true (don't make it conditional on p == NULL) --- diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index 26dfd66154..fbf31f43b4 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -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); } diff --git a/servers/slapd/back-ldbm/delete.c b/servers/slapd/back-ldbm/delete.c index 699e57ca96..79f405a7b5 100644 --- a/servers/slapd/back-ldbm/delete.c +++ b/servers/slapd/back-ldbm/delete.c @@ -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); } diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 7caeacb9df..7fac3f8c8b 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -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; diff --git a/servers/slapd/back-ldbm/modrdn.c b/servers/slapd/back-ldbm/modrdn.c index 83c67468c4..33f6536bdc 100644 --- a/servers/slapd/back-ldbm/modrdn.c +++ b/servers/slapd/back-ldbm/modrdn.c @@ -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); }