1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

Attempt to fix bug 5684

With the ctdb checkin dde9f3f006 tdb optimized out write lock checks for
write-enabled transaction. Sadly, this also removed the possibility to ever
remove dead records left over from tdb_delete calls within a transaction.

Tridge, please check this! Did dde9f3f006 have any reason beyond performance
optimizations?

Thanks,

Volker
(cherry picked from commit 3f884c4ae3)
This commit is contained in:
Volker Lendecke 2008-08-12 22:31:52 +02:00 committed by Stefan Metzmacher
parent ad7ed33f78
commit 1d85e0647e

View File

@ -243,7 +243,7 @@ int tdb_do_delete(struct tdb_context *tdb, tdb_off_t rec_ptr, struct list_struct
if (tdb->read_only || tdb->traverse_read) return -1;
if (tdb->traverse_write != 0 ||
if (((tdb->traverse_write != 0) && (!TDB_DEAD(rec))) ||
tdb_write_lock_record(tdb, rec_ptr) == -1) {
/* Someone traversing here: mark it as dead */
rec->magic = TDB_DEAD_MAGIC;