]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/f2fs/recovery.c
Merge remote-tracking branch 'regmap/fix/debugfs' into tmp
[karo-tx-linux.git] / fs / f2fs / recovery.c
index b07e9b6ef376643e509fa31329765665680600d3..b571fee677d5837e4481c805f82f3f38f8975281 100644 (file)
@@ -144,14 +144,15 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head)
                                goto out;
                        }
 
-                       INIT_LIST_HEAD(&entry->list);
-                       list_add_tail(&entry->list, head);
-
                        entry->inode = f2fs_iget(sbi->sb, ino_of_node(page));
                        if (IS_ERR(entry->inode)) {
                                err = PTR_ERR(entry->inode);
+                               kmem_cache_free(fsync_entry_slab, entry);
                                goto out;
                        }
+
+                       INIT_LIST_HEAD(&entry->list);
+                       list_add_tail(&entry->list, head);
                        entry->blkaddr = blkaddr;
                }
                if (IS_INODE(page)) {
@@ -228,6 +229,9 @@ static void check_index_in_prev_nodes(struct f2fs_sb_info *sbi,
 
        /* Deallocate previous index in the node page */
        inode = f2fs_iget_nowait(sbi->sb, ino);
+       if (IS_ERR(inode))
+               return;
+
        truncate_hole(inode, bidx, bidx + 1);
        iput(inode);
 }