aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/recovery.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/recovery.c')
-rw-r--r--fs/f2fs/recovery.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c
index b07e9b6ef376..f42e4060b399 100644
--- a/fs/f2fs/recovery.c
+++ b/fs/f2fs/recovery.c
@@ -67,7 +67,7 @@ static int recover_dentry(struct page *ipage, struct inode *inode)
67 kunmap(page); 67 kunmap(page);
68 f2fs_put_page(page, 0); 68 f2fs_put_page(page, 0);
69 } else { 69 } else {
70 f2fs_add_link(&dent, inode); 70 err = f2fs_add_link(&dent, inode);
71 } 71 }
72 iput(dir); 72 iput(dir);
73out: 73out:
@@ -144,14 +144,14 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head)
144 goto out; 144 goto out;
145 } 145 }
146 146
147 INIT_LIST_HEAD(&entry->list);
148 list_add_tail(&entry->list, head);
149
150 entry->inode = f2fs_iget(sbi->sb, ino_of_node(page)); 147 entry->inode = f2fs_iget(sbi->sb, ino_of_node(page));
151 if (IS_ERR(entry->inode)) { 148 if (IS_ERR(entry->inode)) {
152 err = PTR_ERR(entry->inode); 149 err = PTR_ERR(entry->inode);
150 kmem_cache_free(fsync_entry_slab, entry);
153 goto out; 151 goto out;
154 } 152 }
153
154 list_add_tail(&entry->list, head);
155 entry->blkaddr = blkaddr; 155 entry->blkaddr = blkaddr;
156 } 156 }
157 if (IS_INODE(page)) { 157 if (IS_INODE(page)) {
@@ -173,10 +173,9 @@ out:
173static void destroy_fsync_dnodes(struct f2fs_sb_info *sbi, 173static void destroy_fsync_dnodes(struct f2fs_sb_info *sbi,
174 struct list_head *head) 174 struct list_head *head)
175{ 175{
176 struct list_head *this; 176 struct fsync_inode_entry *entry, *tmp;
177 struct fsync_inode_entry *entry; 177
178 list_for_each(this, head) { 178 list_for_each_entry_safe(entry, tmp, head, list) {
179 entry = list_entry(this, struct fsync_inode_entry, list);
180 iput(entry->inode); 179 iput(entry->inode);
181 list_del(&entry->list); 180 list_del(&entry->list);
182 kmem_cache_free(fsync_entry_slab, entry); 181 kmem_cache_free(fsync_entry_slab, entry);
@@ -228,6 +227,9 @@ static void check_index_in_prev_nodes(struct f2fs_sb_info *sbi,
228 227
229 /* Deallocate previous index in the node page */ 228 /* Deallocate previous index in the node page */
230 inode = f2fs_iget_nowait(sbi->sb, ino); 229 inode = f2fs_iget_nowait(sbi->sb, ino);
230 if (IS_ERR(inode))
231 return;
232
231 truncate_hole(inode, bidx, bidx + 1); 233 truncate_hole(inode, bidx, bidx + 1);
232 iput(inode); 234 iput(inode);
233} 235}