diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-02-24 10:50:41 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-02-24 10:50:41 +1030 |
commit | 8c3fda4318adc71899bc41486d5616da3a91a688 (patch) | |
tree | 1c274b45ee9e0be25f46e320659352b5e1a26456 | |
parent | 9f295eecffd92e55584fc36539cd85cd32c832de (diff) | |
download | samba-8c3fda4318adc71899bc41486d5616da3a91a688.tar.gz samba-8c3fda4318adc71899bc41486d5616da3a91a688.tar.bz2 samba-8c3fda4318adc71899bc41486d5616da3a91a688.zip |
tdb: don't truncate tdb on recovery
The current recovery code truncates the tdb file on recovery. This is
fine if recovery is only done on first open, but is a really bad idea
as we move to allowing recovery on "live" databases.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
-rw-r--r-- | lib/tdb/common/transaction.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c index 763afffc52..3d267af2b0 100644 --- a/lib/tdb/common/transaction.c +++ b/lib/tdb/common/transaction.c @@ -1180,16 +1180,6 @@ int tdb_transaction_recover(struct tdb_context *tdb) return -1; } - /* reduce the file size to the old size */ - tdb_munmap(tdb); - if (ftruncate(tdb->fd, recovery_eof) != 0) { - TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to reduce to recovery size\n")); - tdb->ecode = TDB_ERR_IO; - return -1; - } - tdb->map_size = recovery_eof; - tdb_mmap(tdb); - if (transaction_sync(tdb, 0, recovery_eof) == -1) { TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction_recover: failed to sync2 recovery\n")); tdb->ecode = TDB_ERR_IO; |