Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
615e303e
Commit
615e303e
authored
16 years ago
by
Quanah Gibson-Mount
Browse files
Options
Downloads
Patches
Plain Diff
ITS#5439
parent
925da7ea
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGES
+1
-0
1 addition, 0 deletions
CHANGES
servers/slapd/back-bdb/cache.c
+33
-13
33 additions, 13 deletions
servers/slapd/back-bdb/cache.c
with
34 additions
and
13 deletions
CHANGES
+
1
−
0
View file @
615e303e
...
...
@@ -18,6 +18,7 @@ OpenLDAP 2.4.9 Engineering
Fixed slapd syncrepl refreshAndPersist (ITS#5454)
Fixed slapd syncrepl modrdn processing (ITS#5397)
Fixed slapd/slapo-accesslog rq mutex usage (ITS#5442)
Fixed slapd-bdb ID_NOCACHE handling (ITS#5439)
Fixed slapd-ldap connection handler (ITS#5404)
Fixed slapo-auditlog unnecessary syscall (ITS#5441)
Fixed slapo-refint dnSubtreeMatch (ITS#5427)
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-bdb/cache.c
+
33
−
13
View file @
615e303e
...
...
@@ -252,16 +252,27 @@ bdb_cache_return_entry_rw( struct bdb_info *bdb, Entry *e,
int
free
=
0
;
ei
=
e
->
e_private
;
bdb_cache_entry_db_unlock
(
bdb
,
lock
);
if
(
ei
)
{
bdb_cache_entryinfo_lock
(
ei
)
;
if
(
ei
&&
(
ei
->
bei_state
&
CACHE_ENTRY_NOT_CACHED
)
&&
(
bdb_cache_entryinfo_
try
lock
(
ei
)
==
0
))
{
if
(
ei
->
bei_state
&
CACHE_ENTRY_NOT_CACHED
)
{
/* Releasing the entry can only be done when
* we know that nobody else is using it, i.e we
* should have an entry_db writelock. But the
* flag is only set by the thread that loads the
* entry, and only if no other threads has found
* it while it was working. All other threads
* clear the flag, which mean that we should be
* the only thread using the entry if the flag
* is set here.
*/
ei
->
bei_e
=
NULL
;
ei
->
bei_state
^=
CACHE_ENTRY_NOT_CACHED
;
free
=
1
;
}
bdb_cache_entryinfo_unlock
(
ei
);
}
bdb_cache_entry_db_unlock
(
bdb
,
lock
);
if
(
free
)
{
e
->
e_private
=
NULL
;
bdb_entry_return
(
e
);
...
...
@@ -854,6 +865,11 @@ again: ldap_pvt_thread_rdwr_rlock( &bdb->bi_cache.c_rwlock );
/* Ok, we found the info, do we have the entry? */
if
(
rc
==
0
)
{
if
(
!
(
flag
&
ID_LOCKED
))
{
bdb_cache_entryinfo_lock
(
*
eip
);
flag
|=
ID_LOCKED
;
}
if
(
(
*
eip
)
->
bei_state
&
CACHE_ENTRY_DELETED
)
{
rc
=
DB_NOTFOUND
;
}
else
{
...
...
@@ -873,13 +889,13 @@ load1:
(
*
eip
)
->
bei_state
|=
CACHE_ENTRY_LOADING
;
}
/* If the entry was loaded before but uncached, and we need
* it again, c
lear the uncached state
*
/
if
(
(
*
eip
)
->
bei_state
&
CACHE_ENTRY_NOT_CACHED
)
{
(
*
eip
)
->
bei_state
^=
CACHE_ENTRY_NOT_CACHED
;
if
(
flag
&
ID
_NOCACHE
)
flag
^
=
ID_NOCACHE
;
if
(
!
load
)
{
/* C
lear the uncached state
if we are not
*
loading it, i.e it is already cached or
* another thread is currently loading it.
*/
(
*
eip
)
->
bei_state
&=
~
CACHE_ENTRY
_NO
T_
CACHE
D
;
flag
&
=
~
ID_NOCACHE
;
}
if
(
flag
&
ID_LOCKED
)
{
...
...
@@ -906,9 +922,13 @@ load1:
#endif
ep
=
NULL
;
bdb_cache_lru_link
(
bdb
,
*
eip
);
if
(
flag
&
ID_NOCACHE
)
{
bdb_cache_entryinfo_lock
(
*
eip
);
(
*
eip
)
->
bei_state
|=
CACHE_ENTRY_NOT_CACHED
;
if
((
flag
&
ID_NOCACHE
)
&&
(
bdb_cache_entryinfo_trylock
(
*
eip
)
==
0
))
{
/* Set the cached state only if no other thread
* found the info while we was loading the entry.
*/
if
(
(
*
eip
)
->
bei_finders
==
1
)
(
*
eip
)
->
bei_state
|=
CACHE_ENTRY_NOT_CACHED
;
bdb_cache_entryinfo_unlock
(
*
eip
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment