summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/f2fs.h
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-05-19 21:10:29 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-05-28 02:03:02 -0400
commit44a83ff6a81d84ab83bcb43a49ff1ba6c7e17cd1 (patch)
tree8b7c8b192d237ee774c0f1ab59f3a0007e463655 /fs/f2fs/f2fs.h
parent64aa7ed98db489d1c41ef140876ada38498678ab (diff)
f2fs: update inode page after creation
I found a bug when testing power-off-recovery as follows. [Bug Scenario] 1. create a file 2. fsync the file 3. reboot w/o any sync 4. try to recover the file - found its fsync mark - found its dentry mark : try to recover its dentry - get its file name - get its parent inode number : here we got zero value The reason why we get the wrong parent inode number is that we didn't synchronize the inode page with its newly created inode information perfectly. Especially, previous f2fs stores fi->i_pino and writes it to the cached node page in a wrong order, which incurs the zero-valued i_pino during the recovery. So, this patch modifies the creation flow to fix the synchronization order of inode page with its inode. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/f2fs.h')
-rw-r--r--fs/f2fs/f2fs.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index cbae2b663eba..9360a03fcc96 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -914,7 +914,6 @@ struct f2fs_dir_entry *f2fs_parent_dir(struct inode *, struct page **);
914ino_t f2fs_inode_by_name(struct inode *, struct qstr *); 914ino_t f2fs_inode_by_name(struct inode *, struct qstr *);
915void f2fs_set_link(struct inode *, struct f2fs_dir_entry *, 915void f2fs_set_link(struct inode *, struct f2fs_dir_entry *,
916 struct page *, struct inode *); 916 struct page *, struct inode *);
917void init_dent_inode(const struct qstr *, struct page *);
918int __f2fs_add_link(struct inode *, const struct qstr *, struct inode *); 917int __f2fs_add_link(struct inode *, const struct qstr *, struct inode *);
919void f2fs_delete_entry(struct f2fs_dir_entry *, struct page *, struct inode *); 918void f2fs_delete_entry(struct f2fs_dir_entry *, struct page *, struct inode *);
920int f2fs_make_empty(struct inode *, struct inode *); 919int f2fs_make_empty(struct inode *, struct inode *);
@@ -949,7 +948,7 @@ void get_node_info(struct f2fs_sb_info *, nid_t, struct node_info *);
949int get_dnode_of_data(struct dnode_of_data *, pgoff_t, int); 948int get_dnode_of_data(struct dnode_of_data *, pgoff_t, int);
950int truncate_inode_blocks(struct inode *, pgoff_t); 949int truncate_inode_blocks(struct inode *, pgoff_t);
951int remove_inode_page(struct inode *); 950int remove_inode_page(struct inode *);
952int new_inode_page(struct inode *, const struct qstr *); 951struct page *new_inode_page(struct inode *, const struct qstr *);
953struct page *new_node_page(struct dnode_of_data *, unsigned int); 952struct page *new_node_page(struct dnode_of_data *, unsigned int);
954void ra_node_page(struct f2fs_sb_info *, nid_t); 953void ra_node_page(struct f2fs_sb_info *, nid_t);
955struct page *get_node_page(struct f2fs_sb_info *, pgoff_t); 954struct page *get_node_page(struct f2fs_sb_info *, pgoff_t);