diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-02-02 18:18:06 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-02-23 10:10:35 -0800 |
commit | e7c75ab099c8c8d4616c2ac10517e86a88b368d1 (patch) | |
tree | e19af673d391917611a269fe286418eba871b72d /fs/f2fs/file.c | |
parent | faa24895acfd49cb61055b762e39ee6a5452a389 (diff) | |
download | linux-e7c75ab099c8c8d4616c2ac10517e86a88b368d1.tar.bz2 |
f2fs: avoid out-of-order execution of atomic writes
We need to flush data writes before flushing last node block writes by using
FUA with PREFLUSH. We don't need to guarantee precedent node writes since if
those are not written, we can't reach to the last node block when scanning
node block chain during roll-forward recovery.
Afterwards f2fs_wait_on_page_writeback guarantees all the IO submission to
disk, which builds a valid node block chain.
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 9c0f469cde13..a3808c49e326 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -278,7 +278,8 @@ sync_nodes: flush_out: remove_ino_entry(sbi, ino, UPDATE_INO); clear_inode_flag(inode, FI_UPDATE_WRITE); - ret = f2fs_issue_flush(sbi); + if (!atomic) + ret = f2fs_issue_flush(sbi); f2fs_update_time(sbi, REQ_TIME); out: trace_f2fs_sync_file_exit(inode, need_cp, datasync, ret); |