summaryrefslogtreecommitdiff
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-05-28 16:59:27 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-05-31 11:31:52 -0700
commit14a28559f43ac7c0b98dd1b0e73ec9ec8ab4fc45 (patch)
tree91fe3903a54c153e82cb2af013bd496723162173 /fs/f2fs/gc.c
parent1174abfd8309f4c47d454734233aa3b694560e10 (diff)
downloadlwn-14a28559f43ac7c0b98dd1b0e73ec9ec8ab4fc45.tar.gz
lwn-14a28559f43ac7c0b98dd1b0e73ec9ec8ab4fc45.zip
f2fs: fix error path of move_data_page
This patch fixes error path of move_data_page: - clear cold data flag if it fails to write page. - redirty page for non-ENOMEM case. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 50bb8fc25275..885032fc3a61 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -780,9 +780,14 @@ retry:
set_cold_data(page);
err = do_write_data_page(&fio);
- if (err == -ENOMEM && is_dirty) {
- congestion_wait(BLK_RW_ASYNC, HZ/50);
- goto retry;
+ if (err) {
+ clear_cold_data(page);
+ if (err == -ENOMEM) {
+ congestion_wait(BLK_RW_ASYNC, HZ/50);
+ goto retry;
+ }
+ if (is_dirty)
+ set_page_dirty(page);
}
}
out: