linux/fs/f2fs
Jaegeuk Kim b2c0829912 f2fs: do checkpoint for the renamed inode
If an inode is renamed, it should be registered as file_lost_pino to conduct
checkpoint at f2fs_sync_file.
Otherwise, the inode cannot be recovered due to no dent_mark in the following
scenario.

Note that, this scenario is from xfstests/322.

1. create "a"
2. fsync "a"
3. rename "a" to "b"
4. fsync "b"
5. Sudden power-cut

After recovery is done, "b" should be seen.
However, the result shows "a", since the recovery procedure does not enter
recover_dentry due to no dent_mark.

The reason is like below.
- The nid of "a" is checkpointed during #2, f2fs_sync_file.
- The inode page for "b" produced by #3 is written without dent_mark by
sync_node_pages.

So, this patch fixes this bug by assinging file_lost_pino to the "a"'s inode.
If the pino is lost, f2fs_sync_file conducts checkpoint, and then recovers
the latest pino and its dentry information for further recovery.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
2014-07-09 05:59:31 -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
acl.c f2fs: pass flags field to setxattr functions 2014-05-07 10:21:56 +09:00
acl.h f2fs: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
checkpoint.c f2fs updates for v3.16 2014-06-09 19:11:44 -07:00
data.c f2fs: fix to report newly allocate region as extent 2014-06-23 10:05:07 +09:00
debug.c f2fs: remove unnecessary threshold 2014-03-20 22:10:09 +09:00
dir.c f2fs: fix error path in init_inode_metadata 2014-07-09 05:58:50 -07:00
f2fs.h f2fs: check lower bound nid value in check_nid_range 2014-07-09 05:58:08 -07:00
file.c f2fs: fix not to allocate unnecessary blocks during fallocate 2014-06-23 10:05:08 +09: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: avoid grab_cache_page_write_begin for data pages 2014-05-07 10:21:58 +09:00
inode.c f2fs: check lower bound nid value in check_nid_range 2014-07-09 05:58:08 -07:00
namei.c f2fs: do checkpoint for the renamed inode 2014-07-09 05:59:31 -07:00
node.c f2fs updates for v3.16 2014-06-09 19:11:44 -07:00
node.h f2fs: fix checkpatch warning 2014-05-07 10:21:59 +09:00
recovery.c f2fs: avoid not to call remove_dirty_inode 2014-06-07 03:18:36 +09:00
segment.c f2fs: remove unused variables in f2fs_sm_info 2014-07-09 05:57:57 -07:00
segment.h f2fs: change reclaim rate in percentage 2014-03-20 22:10:10 +09:00
super.c f2fs: check lower bound nid value in check_nid_range 2014-07-09 05:58:08 -07:00
xattr.c f2fs: fix recursive lock by f2fs_setxattr 2014-06-02 22:13:16 +09:00
xattr.h f2fs: pass flags field to setxattr functions 2014-05-07 10:21:56 +09:00