mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#5129 fix alock_close with Quick mode
This commit is contained in:
parent
6a6adff86c
commit
40e796c547
@ -516,7 +516,7 @@ alock_scan ( alock_info_t * info )
|
||||
}
|
||||
|
||||
int
|
||||
alock_close ( alock_info_t * info )
|
||||
alock_close ( alock_info_t * info, int nosave )
|
||||
{
|
||||
alock_slot_t slot_data;
|
||||
int res;
|
||||
@ -540,7 +540,9 @@ alock_close ( alock_info_t * info )
|
||||
free (slot_data.al_appname);
|
||||
return ALOCK_UNSTABLE;
|
||||
}
|
||||
slot_data.al_lock = ALOCK_UNLOCKED | (slot_data.al_lock & ALOCK_NOSAVE);
|
||||
slot_data.al_lock = ALOCK_UNLOCKED;
|
||||
if ( nosave )
|
||||
slot_data.al_lock |= ALOCK_NOSAVE;
|
||||
res = alock_write_slot (info, &slot_data);
|
||||
if (res == -1) {
|
||||
close (info->al_fd);
|
||||
|
@ -66,7 +66,7 @@ typedef struct alock_slot {
|
||||
LDAP_SLAPD_F (int) alock_open LDAP_P(( alock_info_t * info, const char * appname,
|
||||
const char * envdir, int locktype ));
|
||||
LDAP_SLAPD_F (int) alock_scan LDAP_P(( alock_info_t * info ));
|
||||
LDAP_SLAPD_F (int) alock_close LDAP_P(( alock_info_t * info ));
|
||||
LDAP_SLAPD_F (int) alock_close LDAP_P(( alock_info_t * info, int nosave ));
|
||||
LDAP_SLAPD_F (int) alock_recover LDAP_P(( alock_info_t * info ));
|
||||
|
||||
LDAP_END_DECL
|
||||
|
@ -195,9 +195,11 @@ bdb_db_open( BackendDB *be, ConfigReply *cr )
|
||||
be->be_suffix[0].bv_val, 0, 0 );
|
||||
if ( quick ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"Cannot use Quick mode, perform manual recovery first.\n",
|
||||
"Cannot use Quick mode; perform manual recovery first.\n",
|
||||
0, 0, 0 );
|
||||
return -1;
|
||||
slapMode ^= SLAP_TOOL_QUICK;
|
||||
rc = -1;
|
||||
goto fail;
|
||||
} else {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"Performing database recovery to activate new settings.\n",
|
||||
@ -614,7 +616,7 @@ bdb_db_close( BackendDB *be, ConfigReply *cr )
|
||||
}
|
||||
}
|
||||
|
||||
rc = alock_close( &bdb->bi_alock_info );
|
||||
rc = alock_close( &bdb->bi_alock_info, slapMode & SLAP_TOOL_QUICK );
|
||||
if( rc != 0 ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"bdb_db_close: database \"%s\": alock_close failed\n",
|
||||
|
Loading…
Reference in New Issue
Block a user