f2fs: fix error path of recovery
There are some places in where we missed to unlock page or unlock page incorrectly, fix them. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
b9973998d9
commit
0d7333632d
1 changed files with 11 additions and 4 deletions
|
@ -317,8 +317,10 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head,
|
|||
break;
|
||||
}
|
||||
|
||||
if (!is_recoverable_dnode(page))
|
||||
if (!is_recoverable_dnode(page)) {
|
||||
f2fs_put_page(page, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!is_fsync_dnode(page))
|
||||
goto next;
|
||||
|
@ -330,8 +332,10 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head,
|
|||
if (!check_only &&
|
||||
IS_INODE(page) && is_dent_dnode(page)) {
|
||||
err = f2fs_recover_inode_page(sbi, page);
|
||||
if (err)
|
||||
if (err) {
|
||||
f2fs_put_page(page, 1);
|
||||
break;
|
||||
}
|
||||
quota_inode = true;
|
||||
}
|
||||
|
||||
|
@ -347,6 +351,7 @@ static int find_fsync_dnodes(struct f2fs_sb_info *sbi, struct list_head *head,
|
|||
err = 0;
|
||||
goto next;
|
||||
}
|
||||
f2fs_put_page(page, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -362,6 +367,7 @@ next:
|
|||
"%s: detect looped node chain, "
|
||||
"blkaddr:%u, next:%u",
|
||||
__func__, blkaddr, next_blkaddr_of_node(page));
|
||||
f2fs_put_page(page, 1);
|
||||
err = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
@ -372,7 +378,6 @@ next:
|
|||
|
||||
f2fs_ra_meta_pages_cond(sbi, blkaddr);
|
||||
}
|
||||
f2fs_put_page(page, 1);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -658,8 +663,10 @@ static int recover_data(struct f2fs_sb_info *sbi, struct list_head *inode_list,
|
|||
*/
|
||||
if (IS_INODE(page)) {
|
||||
err = recover_inode(entry->inode, page);
|
||||
if (err)
|
||||
if (err) {
|
||||
f2fs_put_page(page, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (entry->last_dentry == blkaddr) {
|
||||
err = recover_dentry(entry->inode, page, dir_list);
|
||||
|
|
Loading…
Add table
Reference in a new issue