linux/fs/f2fs
Jaegeuk Kim 75a037f360 f2fs: fix livelock in swapfile writes
This patch fixes livelock in the below call path when writing swap pages.

[46374.617256] c2    701  __switch_to+0xe4/0x100
[46374.617265] c2    701  __schedule+0x80c/0xbc4
[46374.617273] c2    701  schedule+0x74/0x98
[46374.617281] c2    701  rwsem_down_read_failed+0x190/0x234
[46374.617291] c2    701  down_read+0x58/0x5c
[46374.617300] c2    701  f2fs_map_blocks+0x138/0x9a8
[46374.617310] c2    701  get_data_block_dio_write+0x74/0x104
[46374.617320] c2    701  __blockdev_direct_IO+0x1350/0x3930
[46374.617331] c2    701  f2fs_direct_IO+0x55c/0x8bc
[46374.617341] c2    701  __swap_writepage+0x1d0/0x3e8
[46374.617351] c2    701  swap_writepage+0x44/0x54
[46374.617360] c2    701  shrink_page_list+0x140/0xe80
[46374.617371] c2    701  shrink_inactive_list+0x510/0x918
[46374.617381] c2    701  shrink_node_memcg+0x2d4/0x804
[46374.617391] c2    701  shrink_node+0x10c/0x2f8
[46374.617400] c2    701  do_try_to_free_pages+0x178/0x38c
[46374.617410] c2    701  try_to_free_pages+0x348/0x4b8
[46374.617419] c2    701  __alloc_pages_nodemask+0x7f8/0x1014
[46374.617429] c2    701  pagecache_get_page+0x184/0x2cc
[46374.617438] c2    701  f2fs_new_node_page+0x60/0x41c
[46374.617449] c2    701  f2fs_new_inode_page+0x50/0x7c
[46374.617460] c2    701  f2fs_init_inode_metadata+0x128/0x530
[46374.617472] c2    701  f2fs_add_inline_entry+0x138/0xd64
[46374.617480] c2    701  f2fs_do_add_link+0xf4/0x178
[46374.617488] c2    701  f2fs_create+0x1e4/0x3ac
[46374.617497] c2    701  path_openat+0xdc0/0x1308
[46374.617507] c2    701  do_filp_open+0x78/0x124
[46374.617516] c2    701  do_sys_open+0x134/0x248
[46374.617525] c2    701  SyS_openat+0x14/0x20

Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2019-08-16 14:03:52 -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: fix livelock in swapfile writes 2019-08-16 14:03:52 -07:00
debug.c f2fs: ioctl for removing a range from F2FS 2019-07-02 15:39:24 -07:00
dir.c f2fs: use generic EFSBADCRC/EFSCORRUPTED 2019-07-02 15:40:41 -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: support swap file w/ DIO 2019-07-03 08:52:54 -07:00
file.c f2fs: remove redundant check from f2fs_setflags_common() 2019-07-12 19:39:07 -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: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
inline.c f2fs: use generic EFSBADCRC/EFSCORRUPTED 2019-07-02 15:40:41 -07:00
inode.c f2fs: use generic EFSBADCRC/EFSCORRUPTED 2019-07-02 15:40:41 -07:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02: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: introduce f2fs_<level> macros to wrap f2fs_printk() 2019-07-02 15:40:40 -07:00
node.c f2fs: use generic EFSBADCRC/EFSCORRUPTED 2019-07-02 15:40:41 -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: avoid out-of-range memory access 2019-07-10 18:13:53 -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-for-5.4-rc3 2019-07-30 13:15:39 -07:00
sysfs.c f2fs: avoid get_valid_blocks() for cleanup 2019-07-02 15:40:40 -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: set SBI_NEED_FSCK for xattr corruption case 2019-07-02 15:40:41 -07:00
xattr.h f2fs: fix to avoid accessing xattr across the boundary 2019-05-09 09:43:29 -07:00