From 0fc70327485deeab63120cc5781af9e45b062c50 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 30 Mar 2003 05:33:42 +0000 Subject: [PATCH] Fix giant lock conflict in previous commit --- servers/slapd/back-ldbm/entry.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-ldbm/entry.c b/servers/slapd/back-ldbm/entry.c index 8ebf0ab2c5..cda24c9155 100644 --- a/servers/slapd/back-ldbm/entry.c +++ b/servers/slapd/back-ldbm/entry.c @@ -31,11 +31,18 @@ ldbm_back_entry_release_rw( if ( slapMode == SLAP_SERVER_MODE ) { /* free entry and reader or writer lock */ cache_return_entry_rw( &li->li_cache, e, rw ); + /* only do_add calls here with a write lock. + * get_entry doesn't obtain the giant lock, because its + * caller has already obtained it. + */ if( rw ) { ldap_pvt_thread_rdwr_wunlock( &li->li_giant_rwlock ); - } else { + } +#if 0 + else { ldap_pvt_thread_rdwr_runlock( &li->li_giant_rwlock ); } +#endif } else { entry_free( e ); @@ -75,6 +82,8 @@ int ldbm_back_entry_get( oc ? oc->soc_cname.bv_val : "(null)", at_name, 0); #endif + /* don't grab the giant lock - our caller has already gotten it. */ + /* can we find entry */ e = dn2entry_rw( be, ndn, NULL, rw ); if (e == NULL) { -- 2.39.5