Skip to content

Commit 26e6f59

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: fix to avoid forcing direct write to use buffered IO on inline_data inode
Jinsu Lee reported a performance regression issue, after commit 5c8764f ("f2fs: fix to force buffered IO on inline_data inode"), we forced direct write to use buffered IO on inline_data inode, it will cause performace regression due to memory copy and data flush. It's fine to not force direct write to use buffered IO, as it can convert inline inode before committing direct write IO. Fixes: 5c8764f ("f2fs: fix to force buffered IO on inline_data inode") Reported-by: Jinsu Lee <[email protected]> Closes: https://lore.kernel.org/linux-f2fs-devel/[email protected] Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 5dd00eb commit 26e6f59

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/f2fs/file.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,11 @@ static bool f2fs_force_buffered_io(struct inode *inode, int rw)
883883
return true;
884884
if (f2fs_compressed_file(inode))
885885
return true;
886-
if (f2fs_has_inline_data(inode))
886+
/*
887+
* only force direct read to use buffered IO, for direct write,
888+
* it expects inline data conversion before committing IO.
889+
*/
890+
if (f2fs_has_inline_data(inode) && rw == READ)
887891
return true;
888892

889893
/* disallow direct IO if any of devices has unaligned blksize */

0 commit comments

Comments
 (0)