git.samba.org
/
mat
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5f7b481
)
tdb: Don't purge records to a blocked freelist
author
Volker Lendecke
<vl@samba.org>
Mon, 17 Mar 2014 05:47:11 +0000
(06:47 +0100)
committer
Michael Adam
<obnox@samba.org>
Tue, 18 Mar 2014 12:42:10 +0000
(13:42 +0100)
If the freelist is heavily contended, we should avoid accessing it
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
lib/tdb/common/tdb.c
patch
|
blob
|
history
diff --git
a/lib/tdb/common/tdb.c
b/lib/tdb/common/tdb.c
index 3aabcfa9e606671efc19114ee954150133d28ccd..634a5526d71893ecfd8b4f99ab540c0279bb3707 100644
(file)
--- a/
lib/tdb/common/tdb.c
+++ b/
lib/tdb/common/tdb.c
@@
-351,7
+351,10
@@
static int tdb_purge_dead(struct tdb_context *tdb, uint32_t hash)
struct tdb_record rec;
tdb_off_t rec_ptr;
- if (tdb_lock(tdb, -1, F_WRLCK) == -1) {
+ if (tdb_lock_nonblock(tdb, -1, F_WRLCK) == -1) {
+ /*
+ * Don't block the freelist if not strictly necessary
+ */
return -1;
}