2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-17 01:34:00 +08:00
linux-next/fs/f2fs
Sahitya Tummala e4589fa545 f2fs: fix sbi->extent_list corruption issue
When there is a failure in f2fs_fill_super() after/during
the recovery of fsync'd nodes, it frees the current sbi and
retries again. This time the mount is successful, but the files
that got recovered before retry, still holds the extent tree,
whose extent nodes list is corrupted since sbi and sbi->extent_list
is freed up. The list_del corruption issue is observed when the
file system is getting unmounted and when those recoverd files extent
node is being freed up in the below context.

list_del corruption. prev->next should be fffffff1e1ef5480, but was (null)
<...>
kernel BUG at kernel/msm-4.14/lib/list_debug.c:53!
lr : __list_del_entry_valid+0x94/0xb4
pc : __list_del_entry_valid+0x94/0xb4
<...>
Call trace:
__list_del_entry_valid+0x94/0xb4
__release_extent_node+0xb0/0x114
__free_extent_tree+0x58/0x7c
f2fs_shrink_extent_tree+0xdc/0x3b0
f2fs_leave_shrinker+0x28/0x7c
f2fs_put_super+0xfc/0x1e0
generic_shutdown_super+0x70/0xf4
kill_block_super+0x2c/0x5c
kill_f2fs_super+0x44/0x50
deactivate_locked_super+0x60/0x8c
deactivate_super+0x68/0x74
cleanup_mnt+0x40/0x78
__cleanup_mnt+0x1c/0x28
task_work_run+0x48/0xd0
do_notify_resume+0x678/0xe98
work_pending+0x8/0x14

Fix this by not creating extents for those recovered files if shrinker is
not registered yet. Once mount is successful and shrinker is registered,
those files can have extents again.

Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2018-12-26 15:16:54 -08:00
..
acl.c f2fs: use kvmalloc, if kmalloc is failed 2018-12-26 15:16:53 -08:00
acl.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
checkpoint.c f2fs: clean up checkpoint flow 2018-12-26 15:16:54 -08:00
data.c f2fs: use kvmalloc, if kmalloc is failed 2018-12-26 15:16:53 -08:00
debug.c f2fs: correct wrong spelling, issing_* 2018-12-26 15:16:54 -08:00
dir.c f2fs: check memory boundary by insane namelen 2018-11-26 15:53:57 -08:00
extent_cache.c f2fs: use rb_*_cached friends 2018-10-16 09:36:59 -07:00
f2fs.h f2fs: fix sbi->extent_list corruption issue 2018-12-26 15:16:54 -08:00
file.c f2fs: add an ioctl() to explicitly trigger fsck later 2018-12-14 06:38:02 -08:00
gc.c f2fs: use kvmalloc, if kmalloc is failed 2018-12-26 15:16:53 -08: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 kvmalloc, if kmalloc is failed 2018-12-26 15:16:53 -08:00
inode.c f2fs: clean up f2fs_sb_has_##feature_name 2018-11-26 15:53:55 -08:00
Kconfig fs/*/Kconfig: drop links to 404-compliant http://acl.bestbits.at 2018-01-01 12:45:37 -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: use kvmalloc, if kmalloc is failed 2018-12-26 15:16:53 -08:00
node.c f2fs: use kvmalloc, if kmalloc is failed 2018-12-26 15:16:53 -08:00
node.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
recovery.c f2fs: clean up f2fs_sb_has_##feature_name 2018-11-26 15:53:55 -08:00
segment.c f2fs: flush stale issued discard candidates 2018-12-26 15:16:54 -08:00
segment.h f2fs: introduce __is_large_section() for cleanup 2018-11-26 15:53:55 -08:00
shrinker.c f2fs: fix sbi->extent_list corruption issue 2018-12-26 15:16:54 -08:00
super.c f2fs: use kvmalloc, if kmalloc is failed 2018-12-26 15:16:53 -08:00
sysfs.c f2fs: export migration_granularity sysfs entry 2018-11-26 15:53:56 -08:00
trace.c f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
trace.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
xattr.c f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00
xattr.h f2fs: add SPDX license identifiers 2018-09-12 13:07:10 -07:00