f2fs: direct I/O -> buffered I/O for FI_NO_PREALLOC & FI_INLINE_DATA
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 5 lines · On 2017/9/29 5:47, [email protected] wrote:
From: Weichao Guo <[email protected]>
In
FI_NO_PREALLOCcases, direct I/O path may allocate blocks for an inode but keep its inline data flag. This inconsistency may trigger vfsclear_inodenrpagesbug_onwhen evicting the inode. Let buffered I/O handle this case.
Good catch!
Could we just convert inline data by force in f2fs_preallocate_blocks for this case? it can avoid write fallback from direct IO to buffered IO.
Thanks,
Quoted 12 lines
Signed-off-by Weichao Guo <[email protected]>--- fs/f2fs/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/data.c +0
-0
fs/f2fs/data.c static int __allocate_data_block(struct dnode_of_data *dn) · line 828
Quoted 8 lines
fs/f2fs/data.c +1
-1@@ -822,7 +822,7 @@ static int __allocate_data_block(struct dnode_of_data *dn)static inline bool __force_buffered_io (struct inode *inode,int rw) { -return (f2fs_encrypted_file (inode) || +return (f2fs_encrypted_file (inode) ||f2fs_has_inline_data (inode) || (rw ==WRITE &&test_opt (F2FS_I_SB (inode),LFS )) ||F2FS_I_SB (inode)->s_ndevs); }
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Sure, I will prepare another patch to fix this case.
Quoted 27 lines · Chao Yu
Quoted 5 lines · On 2017/9/29 5:47, [email protected] wrote:
From: Weichao Guo <[email protected]>
In
FI_NO_PREALLOCcases, direct I/O path may allocate blocks for an inode but keep its inline data flag. This inconsistency may trigger vfsclear_inodenrpagesbug_onwhen evicting the inode. Let buffered I/O handle this case.Good catch!
Could we just convert inline data by force in
f2fs_preallocate_blocksfor this case? it can avoid write fallback from direct IO to buffered IO.Thanks,
Quoted 12 lines
Signed-off-by Weichao Guo <[email protected]>--- fs/f2fs/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/f2fs/data.c +0
-0@@ -822,7 +822,7 @@ static int __allocate_data_block(struct dnode_of_data *dn)
Quoted 11 lines
fs/f2fs/data.c static int __allocate_data_block(struct dnode_of_data *dn) · line 828
Quoted 8 lines
fs/f2fs/data.c +1
-1static inline bool __force_buffered_io (struct inode *inode,int rw) { -return (f2fs_encrypted_file (inode) || +return (f2fs_encrypted_file (inode) ||f2fs_has_inline_data (inode) || (rw ==WRITE &&test_opt (F2FS_I_SB (inode),LFS )) ||F2FS_I_SB (inode)->s_ndevs); }.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot