tdb: use fdatasync() instead of fsync() in transactions
authorAndrew Tridgell <tridge@samba.org>
Sat, 13 Feb 2010 01:57:37 +0000 (12:57 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sat, 13 Feb 2010 11:36:11 +0000 (22:36 +1100)
This might help on some filesystems

lib/tdb/common/transaction.c

index ccb4d955a329e82f6d30607d74321c2af64b1bc1..606eaa7a6fb01d2a54d5438e9b291cfcb8abeba6 100644 (file)
@@ -548,7 +548,7 @@ static int transaction_sync(struct tdb_context *tdb, tdb_off_t offset, tdb_len_t
                return 0;
        }
 
-       if (fsync(tdb->fd) != 0) {
+       if (fdatasync(tdb->fd) != 0) {
                tdb->ecode = TDB_ERR_IO;
                TDB_LOG((tdb, TDB_DEBUG_FATAL, "tdb_transaction: fsync failed\n"));
                return -1;