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
This commit is contained in:
Azat Khuzhin 2014-09-23 00:16:49 +04:00
parent 49937e8acf
commit 4c486f751b

View File

@ -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);