linux/fs/f2fs
Chao Yu 899fee36fa f2fs: fix to avoid data corruption by forbidding SSR overwrite
There is one case can cause data corruption.

- write 4k to fileA
- fsync fileA, 4k data is writebacked to lbaA
- write 4k to fileA
- kworker flushs 4k to lbaB; dnode contain lbaB didn't be persisted yet
- write 4k to fileB
- kworker flush 4k to lbaA due to SSR
- SPOR -> dnode with lbaA will be recovered, however lbaA contains fileB's
data

One solution is tracking all fsynced file's block history, and disallow
SSR overwrite on newly invalidated block on that file.

However, during recovery, no matter the dnode is flushed or fsynced, all
previous dnodes until last fsynced one in node chain can be recovered,
that means we need to record all block change in flushed dnode, which
will cause heavy cost, so let's just use simple fix by forbidding SSR
overwrite directly.

Fixes: 5b6c6be2d8 ("f2fs: use SSR for warm node as well")
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2019-08-23 07:57:14 -07: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: add a rw_sem to cover quota flag changes 2019-07-02 15:40:41 -07:00
data.c f2fs: support fiemap() for directory inode 2019-08-23 07:57:11 -07: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: Support case-insensitive file name lookups 2019-08-23 07:57:13 -07:00
extent_cache.c f2fs: introduce f2fs_<level> macros to wrap f2fs_printk() 2019-07-02 15:40:40 -07:00
f2fs.h f2fs: use wrapped IS_SWAPFILE() 2019-08-23 07:57:13 -07:00
file.c f2fs: remove duplicate code in f2fs_file_write_iter 2019-08-23 07:57:14 -07:00
gc.c f2fs: fix to read source block before invalidating it 2019-07-26 17:49:04 -07: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: Support case-insensitive file name lookups 2019-08-23 07:57:13 -07:00
inode.c f2fs: use wrapped f2fs_cp_error() 2019-08-23 07:57:13 -07:00
Kconfig f2fs: Fix build error while CONFIG_NLS=m 2019-08-23 07:57:14 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
namei.c f2fs: Support case-insensitive file name lookups 2019-08-23 07:57:13 -07:00
node.c f2fs: fix wrong available node count calculation 2019-08-23 07:57:14 -07:00
node.h f2fs: check PageWriteback flag for ordered case 2018-12-26 15:16:56 -08:00
recovery.c f2fs: use generic EFSBADCRC/EFSCORRUPTED 2019-07-02 15:40:41 -07:00
segment.c f2fs: fix to avoid data corruption by forbidding SSR overwrite 2019-08-23 07:57:14 -07:00
segment.h f2fs: use generic EFSBADCRC/EFSCORRUPTED 2019-07-02 15:40:41 -07:00
shrinker.c f2fs: fix sbi->extent_list corruption issue 2018-12-26 15:16:54 -08:00
super.c f2fs: fix wrong available node count calculation 2019-08-23 07:57:14 -07:00
sysfs.c f2fs: include charset encoding information in the superblock 2019-08-23 07:57:13 -07: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
xattr.c f2fs: fix to detect cp error in f2fs_setxattr() 2019-08-23 07:57:11 -07:00
xattr.h f2fs: fix to avoid accessing xattr across the boundary 2019-05-09 09:43:29 -07:00