summaryrefslogtreecommitdiff
path: root/lib/ntdb
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-06-19 12:39:33 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-06-19 05:38:06 +0200
commit6d5a3e1602a1db8ca8e778f5e4f40bb623dff1e7 (patch)
tree96559bfc875647ff804da05d22fc677b8cafe7d8 /lib/ntdb
parent89b0d5ac6cd7f2c47148a9ac87ce8d6aea40050b (diff)
downloadsamba-6d5a3e1602a1db8ca8e778f5e4f40bb623dff1e7.tar.gz
samba-6d5a3e1602a1db8ca8e778f5e4f40bb623dff1e7.tar.bz2
samba-6d5a3e1602a1db8ca8e778f5e4f40bb623dff1e7.zip
ntdb: still prepare recovery area with NTDB_NOSYNC.
NTDB_NOSYNC now just prevents the fsync/msync calls, which speeds testing while still providing full coverage. It also provides safety against processes dying during transaction commit (though obviously, not against the machine dying). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/ntdb')
-rw-r--r--lib/ntdb/transaction.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/ntdb/transaction.c b/lib/ntdb/transaction.c
index 222aa1fdbc..b03bbbdb8a 100644
--- a/lib/ntdb/transaction.c
+++ b/lib/ntdb/transaction.c
@@ -85,8 +85,9 @@
intervention.
- if NTDB_NOSYNC is passed to flags in ntdb_open then transactions are
- still available, but no transaction recovery area is used and no
- fsync/msync calls are made.
+ still available, but fsync/msync calls are made. This means we
+ still are safe against unexpected death during transaction commit,
+ but not against machine reboots.
*/
/*
@@ -977,14 +978,11 @@ static enum NTDB_ERROR _ntdb_transaction_prepare_commit(struct ntdb_context *ntd
return ecode;
}
- /* Since we have whole db locked, we don't need the expansion lock. */
- if (!(ntdb->flags & NTDB_NOSYNC)) {
- /* Sets up ntdb->transaction->recovery and
- * ntdb->transaction->magic_offset. */
- ecode = transaction_setup_recovery(ntdb);
- if (ecode != NTDB_SUCCESS) {
- return ecode;
- }
+ /* Sets up ntdb->transaction->recovery and
+ * ntdb->transaction->magic_offset. */
+ ecode = transaction_setup_recovery(ntdb);
+ if (ecode != NTDB_SUCCESS) {
+ return ecode;
}
ntdb->transaction->prepared = true;