From 4c486f751bc1e27a7222006fcacae030068800b9 Mon Sep 17 00:00:00 2001 From: Azat Khuzhin Date: Tue, 23 Sep 2014 00:16:49 +0400 Subject: [PATCH] simplefs_write: install h_sync (sync on close) for jbd2 handle This will make simplefs journaling more robust. + head -n100 /proc/fs/jbd2/loop0/info 7 transactions (7 requested), each up to 640 blocks average: 0ms waiting for transaction 10ms request delay 26ms running transaction 0ms transaction was being locked 0ms flushing data (in ordered mode) 0ms logging transaction 3459us average transaction commit time 1 handles per transaction 1 blocks per transaction 2 logged blocks per transaction --- simple.c | 1 + 1 file changed, 1 insertion(+) diff --git a/simple.c b/simple.c index 42549fc..c2bb5e2 100644 --- a/simple.c +++ b/simple.c @@ -415,6 +415,7 @@ ssize_t simplefs_write(struct file * filp, const char __user * buf, size_t len, brelse(bh); return retval; } + handle->h_sync = 1; retval = jbd2_journal_stop(handle); if (WARN_ON(retval)) { brelse(bh);