summaryrefslogtreecommitdiff
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-06-07 22:08:23 +0900
committerChanho Park <chanho61.park@samsung.com>2014-03-20 17:34:39 +0900
commit0be263f9f885db9662881bcd9762b1e14c6493b4 (patch)
treeff141e5b0102d26add725c0362c9db00b5cd364a /fs/f2fs/f2fs.h
parente1d9364526935fd55cc47f110ca61f22f60f85e2 (diff)
downloadlinux-3.10-0be263f9f885db9662881bcd9762b1e14c6493b4.tar.gz
linux-3.10-0be263f9f885db9662881bcd9762b1e14c6493b4.tar.bz2
linux-3.10-0be263f9f885db9662881bcd9762b1e14c6493b4.zip
f2fs: sync dir->i_size with its block allocation
If new dentry block is allocated and its i_size is updated, we should update its inode block together in order to sync i_size and its block allocation. Otherwise, we can loose additional dentry block due to the unconsistent i_size. Errorneous Scenario ------------------- In the recovery routine, - recovery_dentry | - __f2fs_add_link | | - get_new_data_page | | | - i_size_write(new_i_size) | | | - mark_inode_dirty_sync(dir) | | - update_parent_metadata | | | - mark_inode_dirty(dir) | - write_checkpoint - sync_dirty_dir_inodes - filemap_flush(dentry_blocks) - f2fs_write_data_page - skip to write the last dentry block due to index < i_size In the above flow, new_i_size is not updated to its inode block so that the last dentry block will be lost accordingly. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index c344a4d640c..27edf59ac12 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -859,6 +859,7 @@ enum {
FI_INC_LINK, /* need to increment i_nlink */
FI_ACL_MODE, /* indicate acl mode */
FI_NO_ALLOC, /* should not allocate any blocks */
+ FI_UPDATE_DIR, /* should update inode block for consistency */
FI_DELAY_IPUT, /* used for the recovery */
};