Commit ce4c638c authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: fix to handle error path of f2fs_ra_meta_pages()

In f2fs_ra_meta_pages(), if f2fs_submit_page_bio() failed, we need to
unlock page, fix it.
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 3fa6a8c5
...@@ -220,6 +220,7 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages, ...@@ -220,6 +220,7 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
.is_por = (type == META_POR), .is_por = (type == META_POR),
}; };
struct blk_plug plug; struct blk_plug plug;
int err;
if (unlikely(type == META_POR)) if (unlikely(type == META_POR))
fio.op_flags &= ~REQ_META; fio.op_flags &= ~REQ_META;
...@@ -263,8 +264,8 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages, ...@@ -263,8 +264,8 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
} }
fio.page = page; fio.page = page;
f2fs_submit_page_bio(&fio); err = f2fs_submit_page_bio(&fio);
f2fs_put_page(page, 0); f2fs_put_page(page, err ? 1 : 0);
} }
out: out:
blk_finish_plug(&plug); blk_finish_plug(&plug);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment