mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
ITS#4088 force cursors to use same locker
This commit is contained in:
parent
47c78c2c95
commit
8f7da062f5
@ -388,6 +388,7 @@ int
|
||||
hdb_cache_find_parent(
|
||||
Operation *op,
|
||||
DB_TXN *txn,
|
||||
u_int32_t locker,
|
||||
ID id,
|
||||
EntryInfo **res )
|
||||
{
|
||||
@ -401,7 +402,7 @@ hdb_cache_find_parent(
|
||||
ei.bei_ckids = 0;
|
||||
|
||||
for (;;) {
|
||||
rc = hdb_dn2id_parent( op, txn, &ei, &eip.bei_id );
|
||||
rc = hdb_dn2id_parent( op, txn, locker, &ei, &eip.bei_id );
|
||||
if ( rc ) break;
|
||||
|
||||
/* Save the previous node, if any */
|
||||
@ -718,7 +719,7 @@ again: ldap_pvt_thread_rdwr_rlock( &bdb->bi_cache.c_rwlock );
|
||||
}
|
||||
}
|
||||
#else
|
||||
rc = hdb_cache_find_parent(op, tid, id, eip );
|
||||
rc = hdb_cache_find_parent(op, tid, locker, id, eip );
|
||||
if ( rc == 0 && *eip ) islocked = 1;
|
||||
#endif
|
||||
}
|
||||
|
@ -709,6 +709,7 @@ int
|
||||
hdb_dn2id_parent(
|
||||
Operation *op,
|
||||
DB_TXN *txn,
|
||||
u_int32_t locker,
|
||||
EntryInfo *ei,
|
||||
ID *idp )
|
||||
{
|
||||
@ -733,6 +734,9 @@ hdb_dn2id_parent(
|
||||
|
||||
rc = db->cursor( db, txn, &cursor, bdb->bi_db_opflags );
|
||||
if ( rc ) return rc;
|
||||
if ( !txn && locker ) {
|
||||
cursor->locker = locker;
|
||||
}
|
||||
|
||||
data.ulen = sizeof(diskNode) + (SLAP_LDAPDN_MAXLEN * 2);
|
||||
d = op->o_tmpalloc( data.ulen, op->o_tmpmemctx );
|
||||
|
@ -124,6 +124,7 @@ int bdb_dn2idl(
|
||||
int bdb_dn2id_parent(
|
||||
Operation *op,
|
||||
DB_TXN *txn,
|
||||
u_int32_t locker,
|
||||
EntryInfo *ei,
|
||||
ID *idp );
|
||||
|
||||
@ -500,6 +501,7 @@ int
|
||||
bdb_cache_find_parent(
|
||||
Operation *op,
|
||||
DB_TXN *txn,
|
||||
u_int32_t locker,
|
||||
ID id,
|
||||
EntryInfo **res
|
||||
);
|
||||
|
@ -214,7 +214,7 @@ Entry* bdb_tool_entry_get( BackendDB *be, ID id )
|
||||
op.o_tmpmemctx = NULL;
|
||||
op.o_tmpmfuncs = &ch_mfuncs;
|
||||
|
||||
rc = bdb_cache_find_parent( &op, NULL, id, &ei );
|
||||
rc = bdb_cache_find_parent( &op, NULL, cursor->locker, id, &ei );
|
||||
if ( rc == LDAP_SUCCESS ) {
|
||||
bdb_cache_entryinfo_unlock( ei );
|
||||
e->e_private = ei;
|
||||
|
Loading…
Reference in New Issue
Block a user