alistair23-linux/fs/f2fs
Jaegeuk Kim 74d0b917ef f2fs: fix BUG_ON during f2fs_evict_inode(dir)
During the dentry recovery routine, recover_inode() triggers __f2fs_add_link
with its directory inode.

In the following scenario, a bug is captured.
 1. dir = f2fs_iget(pino)
 2. __f2fs_add_link(dir, name)
 3. iput(dir)
  -> f2fs_evict_inode() faces with BUG_ON(atomic_read(fi->dirty_dents))

Kernel BUG at ffffffffa01c0676 [verbose debug info unavailable]
[<ffffffffa01c0676>] f2fs_evict_inode+0x276/0x300 [f2fs]
Call Trace:
 [<ffffffff8118ea00>] evict+0xb0/0x1b0
 [<ffffffff8118f1c5>] iput+0x105/0x190
 [<ffffffffa01d2dac>] recover_fsync_data+0x3bc/0x1070 [f2fs]
 [<ffffffff81692e8a>] ? io_schedule+0xaa/0xd0
 [<ffffffff81690acb>] ? __wait_on_bit_lock+0x7b/0xc0
 [<ffffffff8111a0e7>] ? __lock_page+0x67/0x70
 [<ffffffff81165e21>] ? kmem_cache_alloc+0x31/0x140
 [<ffffffff8118a502>] ? __d_instantiate+0x92/0xf0
 [<ffffffff812a949b>] ? security_d_instantiate+0x1b/0x30
 [<ffffffff8118a5b4>] ? d_instantiate+0x54/0x70

This means that we should flush all the dentry pages between iget and iput().
But, during the recovery routine, it is unallowed due to consistency, so we
have to wait the whole recovery process.
And then, write_checkpoint flushes all the dirty dentry blocks, and nicely we
can put the stale dir inodes from the dirty_dir_inode_list.

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2013-05-28 15:03:01 +09:00
..
acl.c mode_t, whack-a-mole at 11... 2013-04-09 14:13:05 -04:00
acl.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
checkpoint.c f2fs: fix BUG_ON during f2fs_evict_inode(dir) 2013-05-28 15:03:01 +09:00
data.c f2fs: fix the inconsistent state of data pages 2013-05-28 15:03:00 +09:00
debug.c f2fs: remove useless #include <linux/proc_fs.h> as we're now using sysfs as debug entry. 2013-04-30 12:07:32 +09:00
dir.c f2fs updates for v3.10 2013-05-08 15:11:48 -07:00
f2fs.h f2fs: fix BUG_ON during f2fs_evict_inode(dir) 2013-05-28 15:03:01 +09:00
file.c f2fs updates for v3.10 2013-05-08 15:11:48 -07:00
gc.c f2fs: remove useless #include <linux/proc_fs.h> as we're now using sysfs as debug entry. 2013-04-30 12:07:32 +09:00
gc.h f2fs: avoid frequent background GC 2013-04-26 10:35:03 +09:00
hash.c f2fs: unify string length declarations and usage 2012-12-28 11:27:53 +09:00
inode.c f2fs: add tracepoints for sync & inode operations 2013-04-23 15:30:27 +09:00
Kconfig f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
Makefile f2fs: update Kconfig and Makefile 2012-12-11 13:43:42 +09:00
namei.c f2fs: avoid deadlock during evict after f2fs_gc 2013-05-08 19:54:08 +09:00
node.c f2fs: fix inconsistency of block count during recovery 2013-05-28 15:03:00 +09:00
node.h f2fs: fix the logic of IS_DNODE() 2013-04-09 18:21:24 +09:00
recovery.c f2fs: fix BUG_ON during f2fs_evict_inode(dir) 2013-05-28 15:03:01 +09:00
segment.c f2fs: modify the number of issued pages to merge IOs 2013-04-30 12:07:32 +09:00
segment.h f2fs: modify the number of issued pages to merge IOs 2013-04-30 12:07:32 +09:00
super.c f2fs updates for v3.10 2013-05-08 15:11:48 -07:00
xattr.c f2fs: introduce a new global lock scheme 2013-04-09 18:21:18 +09:00
xattr.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00