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:
parent
5f7b481349
commit
d1ce0110f0
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user