summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2020-04-10 18:07:20 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2020-04-17 09:17:00 -0700
commitce4c638cdd52b302247434daed4c127f258d9860 (patch)
tree2c12b5e8021b3d43f62bf0ab204fe37607b63c5a /fs/f2fs
parent3fa6a8c5b55d063c6a759e0b354f9d7fc09ffbc0 (diff)
downloadlinux-ce4c638cdd52b302247434daed4c127f258d9860.tar.gz
linux-ce4c638cdd52b302247434daed4c127f258d9860.tar.bz2
linux-ce4c638cdd52b302247434daed4c127f258d9860.zip
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: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/checkpoint.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 852890b72d6a..6be357c8e002 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -220,6 +220,7 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
.is_por = (type == META_POR),
};
struct blk_plug plug;
+ int err;
if (unlikely(type == META_POR))
fio.op_flags &= ~REQ_META;
@@ -263,8 +264,8 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
}
fio.page = page;
- f2fs_submit_page_bio(&fio);
- f2fs_put_page(page, 0);
+ err = f2fs_submit_page_bio(&fio);
+ f2fs_put_page(page, err ? 1 : 0);
}
out:
blk_finish_plug(&plug);