git » libjio » commit 6d2d3b2

Synchonize the journal directory after every unlink()

author Alberto Bertogli
2009-04-17 21:21:06 UTC
committer Alberto Bertogli
2009-04-18 00:35:00 UTC
parent 242628dccd4912a3eb7d02ef11915228baccdaa2

Synchonize the journal directory after every unlink()

This reduces performance in a significant way, but it's safe. Otherwise,
the unlink() could have returned success but don't really make it to the
disk.

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libjio/journal.c +3 -0

diff --git a/libjio/journal.c b/libjio/journal.c
index 550e1c3..be9e04b 100644
--- a/libjio/journal.c
+++ b/libjio/journal.c
@@ -321,6 +321,9 @@ int journal_free(struct journal_op *jop)
 		}
 	}
 
+	if (fsync_dir(jop->fs->jdirfd) != 0)
+		goto exit;
+
 	fiu_exit_on("jio/commit/pre_ok_free_tid");
 	free_tid(jop->fs, jop->id);