summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-05-28 11:59:27 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-03 08:47:39 +0300
commitdf44c0553defe56dfa1113d5712bfa2c8b305f05 (patch)
tree3974776bb03dcae2e8ea7cceb6869f3b644c4059 /fs/f2fs
parentac3db8cb962cf81254de955f374ad5d2085dea56 (diff)
downloadlinux-df44c0553defe56dfa1113d5712bfa2c8b305f05.tar.xz
f2fs: fix error path of move_data_page
[ Upstream commit 14a28559f43ac7c0b98dd1b0e73ec9ec8ab4fc45 ] 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> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/f2fs')
-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 9327411fd93b..6aecdd5b97d0 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -778,9 +778,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: