tdb: use fdatasync() instead of fsync() in transactions
authorAndrew Tridgell <tridge@samba.org>
Thu, 22 Apr 2010 04:23:42 +0000 (13:53 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 22 Apr 2010 04:23:42 +0000 (13:53 +0930)
This might help on some filesystems

(Imported from commit 1373e748aa53fbd3afe4d2377208257d42628d86)

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;