linux/fs/f2fs
Jaegeuk Kim 1e87a78d95 f2fs: avoid to conduct roll-forward due to the remained garbage blocks
The f2fs always scans the next chain of direct node blocks.
But some garbage blocks are able to be remained due to no discard support or
SSR triggers.
This occasionally wreaks recovering wrong inodes that were used or BUG_ONs
due to reallocating node ids as follows.

When mount this f2fs image:
http://linuxtesting.org/downloads/f2fs_fault_image.zip
BUG_ON is triggered in f2fs driver (messages below are generated on
kernel 3.13.2; for other kernels output is similar):

kernel BUG at fs/f2fs/node.c:215!
 Call Trace:
 [<ffffffffa032ebad>] recover_inode_page+0x1fd/0x3e0 [f2fs]
 [<ffffffff811446e7>] ? __lock_page+0x67/0x70
 [<ffffffff81089990>] ? autoremove_wake_function+0x50/0x50
 [<ffffffffa0337788>] recover_fsync_data+0x1398/0x15d0 [f2fs]
 [<ffffffff812b9e5c>] ? selinux_d_instantiate+0x1c/0x20
 [<ffffffff811cb20b>] ? d_instantiate+0x5b/0x80
 [<ffffffffa0321044>] f2fs_fill_super+0xb04/0xbf0 [f2fs]
 [<ffffffff811b861e>] ? mount_bdev+0x7e/0x210
 [<ffffffff811b8769>] mount_bdev+0x1c9/0x210
 [<ffffffffa0320540>] ? validate_superblock+0x210/0x210 [f2fs]
 [<ffffffffa031cf8d>] f2fs_mount+0x1d/0x30 [f2fs]
 [<ffffffff811b9497>] mount_fs+0x47/0x1c0
 [<ffffffff81166e00>] ? __alloc_percpu+0x10/0x20
 [<ffffffff811d4032>] vfs_kern_mount+0x72/0x110
 [<ffffffff811d6763>] do_mount+0x493/0x910
 [<ffffffff811615cb>] ? strndup_user+0x5b/0x80
 [<ffffffff811d6c70>] SyS_mount+0x90/0xe0
 [<ffffffff8166f8d9>] system_call_fastpath+0x16/0x1b

Found by Linux File System Verification project (linuxtesting.org).

Reported-by: Andrey Tsyvarev <tsyvarev@ispras.ru>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2014-05-07 10:21:54 +09:00
..
acl.c f2fs: check the acl's validity before setting 2014-04-07 12:18:30 +09:00
acl.h f2fs: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
checkpoint.c f2fs: avoid to conduct roll-forward due to the remained garbage blocks 2014-05-07 10:21:54 +09:00
data.c f2fs: fix error path when fail to read inline data 2014-04-02 09:56:27 +09:00
debug.c f2fs: remove unnecessary threshold 2014-03-20 22:10:09 +09:00
dir.c f2fs: introduce fi->i_sem to protect fi's info 2014-03-20 22:10:11 +09:00
f2fs.h f2fs: avoid to conduct roll-forward due to the remained garbage blocks 2014-05-07 10:21:54 +09:00
file.c Merge branch 'akpm' (incoming from Andrew) 2014-04-07 16:38:06 -07:00
gc.c f2fs: remove the unused ctor argument of f2fs_kmem_cache_create() 2014-03-10 18:45:14 +09:00
gc.h f2fs: add a sysfs entry to control max_victim_search 2014-01-08 13:45:08 +09:00
hash.c f2fs: unify string length declarations and usage 2012-12-28 11:27:53 +09:00
inline.c f2fs: fix error path when fail to read inline data 2014-04-02 09:56:27 +09:00
inode.c f2fs updates for v3.15 2014-04-07 10:55:36 -07:00
Kconfig f2fs: introduce CONFIG_F2FS_CHECK_FS for BUG_ON control 2013-10-29 15:43:01 +09:00
Makefile f2fs: key functions to handle inline data 2013-12-26 20:40:09 +09:00
namei.c f2fs: fix wrong statistics of inline data 2014-04-07 12:40:58 +09:00
node.c f2fs: use list_for_each_entry{_safe} for simplyfying code 2014-04-02 09:56:27 +09:00
node.h f2fs: skip unnecessary node writes during fsync 2014-03-20 22:10:11 +09:00
recovery.c f2fs: use list_for_each_entry{_safe} for simplyfying code 2014-04-02 09:56:27 +09:00
segment.c f2fs: avoid to conduct roll-forward due to the remained garbage blocks 2014-05-07 10:21:54 +09:00
segment.h f2fs: change reclaim rate in percentage 2014-03-20 22:10:10 +09:00
super.c f2fs: enable flush_merge only in f2fs is not read-only 2014-05-07 10:21:54 +09:00
xattr.c f2fs: avoid unneeded lookup when xattr name length is too long 2014-04-01 18:54:24 +09:00
xattr.h f2fs: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00