1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

tdb: Don't purge records to a blocked freelist

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>
This commit is contained in:
Volker Lendecke 2014-03-17 06:47:11 +01:00 committed by Michael Adam
parent 5f7b481349
commit d1ce0110f0

View File

@ -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;
}