linux/fs/f2fs
Jaegeuk Kim 47501f87c6 f2fs: preallocate DIO blocks when forcing buffered_io
The previous preallocation and DIO decision like below.

                         allow_outplace_dio              !allow_outplace_dio
f2fs_force_buffered_io   (*) No_Prealloc / Buffered_IO   Prealloc / Buffered_IO
!f2fs_force_buffered_io  No_Prealloc / DIO               Prealloc / DIO

But, Javier reported Case (*) where zoned device bypassed preallocation but
fell back to buffered writes in f2fs_direct_IO(), resulting in stale data
being read.

In order to fix the issue, actually we need to preallocate blocks whenever
we fall back to buffered IO like this. No change is made in the other cases.

                         allow_outplace_dio              !allow_outplace_dio
f2fs_force_buffered_io   (*) Prealloc / Buffered_IO      Prealloc / Buffered_IO
!f2fs_force_buffered_io  No_Prealloc / DIO               Prealloc / DIO

Reported-and-tested-by: Javier Gonzalez <javier@javigon.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Reviewed-by: Javier González <javier@javigon.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2019-12-09 15:57:45 -08:00
..
acl.c f2fs: Replace spaces with tab 2019-05-08 21:23:11 -07:00
acl.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
checkpoint.c f2fs: show f2fs instance in printk_ratelimited 2019-11-19 14:41:21 -08:00
data.c f2fs: preallocate DIO blocks when forcing buffered_io 2019-12-09 15:57:45 -08:00
debug.c fs: f2fs: Remove unnecessary checks of SM_I(sbi) in update_general_status() 2019-08-23 07:57:12 -07:00
dir.c f2fs: show f2fs instance in printk_ratelimited 2019-11-19 14:41:21 -08:00
extent_cache.c f2fs: introduce f2fs_<level> macros to wrap f2fs_printk() 2019-07-02 15:40:40 -07:00
f2fs.h f2fs: Fix deadlock in f2fs_gc() context during atomic files handling 2019-11-19 14:41:21 -08:00
file.c f2fs: preallocate DIO blocks when forcing buffered_io 2019-12-09 15:57:45 -08:00
gc.c f2fs: stop GC when the victim becomes fully valid 2019-11-25 10:01:28 -08:00
gc.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
hash.c f2fs: Support case-insensitive file name lookups 2019-08-23 07:57:13 -07:00
inline.c f2fs: fix to avoid accessing uninitialized field of inode page in is_alive() 2019-09-16 08:38:26 -07:00
inode.c f2fs: show f2fs instance in printk_ratelimited 2019-11-19 14:41:21 -08:00
Kconfig f2fs: Add a small clarification to CONFIG_FS_F2FS_FS_SECURITY 2019-09-16 08:38:48 -07:00
Makefile f2fs: add fs-verity support 2019-08-12 19:33:51 -07:00
namei.c f2fs: fix to update dir's i_pino during cross_rename 2019-11-07 11:15:39 -08:00
node.c f2fs: show f2fs instance in printk_ratelimited 2019-11-19 14:41:21 -08:00
node.h f2fs: check PageWriteback flag for ordered case 2018-12-26 15:16:56 -08:00
recovery.c f2fs: support aligned pinned file 2019-11-07 10:40:59 -08:00
segment.c f2fs-for-5.5-rc1 2019-11-30 11:02:30 -08:00
segment.h f2fs: support aligned pinned file 2019-11-07 10:40:59 -08:00
shrinker.c f2fs: fix sbi->extent_list corruption issue 2018-12-26 15:16:54 -08:00
super.c \n 2019-11-30 11:16:07 -08:00
sysfs.c f2fs: expose main_blkaddr in sysfs 2019-11-25 10:01:27 -08:00
trace.c f2fs: do not use mutex lock in atomic context 2019-03-05 19:58:06 -08:00
trace.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
verity.c f2fs: add fs-verity support 2019-08-12 19:33:51 -07:00
xattr.c f2fs: fix to avoid memory leakage in f2fs_listxattr 2019-10-22 10:32:42 -07:00
xattr.h f2fs: add fs-verity support 2019-08-12 19:33:51 -07:00