diff options
author | Volker Lendecke <vl@samba.org> | 2018-10-23 13:40:34 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2018-10-29 23:36:24 +0100 |
commit | 96f6768e05493bc47431fb954335349f56af822e (patch) | |
tree | dc2803fd560884f6927296272ca688f085d83b98 /lib/tdb | |
parent | c18e2ed00f199a6c48d3e9c9dd7213b723e80f5b (diff) | |
download | samba-96f6768e05493bc47431fb954335349f56af822e.tar.gz |
tdb: Don't delete dead records in traverse
The next commit will change the handling of dead records, removing the
"tdb_do_delete" function. As traverses should not happen in normal
operations, dead records from them should be rare, and relying on
traverses to remove them is a very bad idea IMHO.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/tdb')
-rw-r--r-- | lib/tdb/common/traverse.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/lib/tdb/common/traverse.c b/lib/tdb/common/traverse.c index 7a1d567cc01..a9af1d4b824 100644 --- a/lib/tdb/common/traverse.c +++ b/lib/tdb/common/traverse.c @@ -96,7 +96,6 @@ static tdb_off_t tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock /* Iterate through chain */ while( tlock->off) { - tdb_off_t current; if (tdb_rec_read(tdb, tlock->off, rec) == -1) goto fail; @@ -114,12 +113,7 @@ static tdb_off_t tdb_next_lock(struct tdb_context *tdb, struct tdb_traverse_lock return tlock->off; } - /* Try to clean dead ones from old traverses */ - current = tlock->off; tlock->off = rec->next; - if (!(tdb->read_only || tdb->traverse_read) && - tdb_do_delete(tdb, current, rec) != 0) - goto fail; } tdb_unlock(tdb, tlock->list, tlock->lock_rw); want_next = 0; |