Skip to content

Commit c550e25

Browse files
author
Jaegeuk Kim
committed
f2fs: use flush command instead of FUA for zoned device
The block layer for zoned disk can reorder the FUA'ed IOs. Let's use flush command to keep the write order. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent dc2f78e commit c550e25

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

fs/f2fs/file.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,8 @@ static int f2fs_do_sync_file(struct file *file, loff_t start, loff_t end,
372372
f2fs_remove_ino_entry(sbi, ino, APPEND_INO);
373373
clear_inode_flag(inode, FI_APPEND_WRITE);
374374
flush_out:
375-
if (!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER)
375+
if ((!atomic && F2FS_OPTION(sbi).fsync_mode != FSYNC_MODE_NOBARRIER) ||
376+
(atomic && !test_opt(sbi, NOBARRIER) && f2fs_sb_has_blkzoned(sbi)))
376377
ret = f2fs_issue_flush(sbi, inode->i_ino);
377378
if (!ret) {
378379
f2fs_remove_ino_entry(sbi, ino, UPDATE_INO);

fs/f2fs/node.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1631,7 +1631,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
16311631
goto redirty_out;
16321632
}
16331633

1634-
if (atomic && !test_opt(sbi, NOBARRIER))
1634+
if (atomic && !test_opt(sbi, NOBARRIER) && !f2fs_sb_has_blkzoned(sbi))
16351635
fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
16361636

16371637
/* should add to global list before clearing PAGECACHE status */

0 commit comments

Comments
 (0)