diff options
author | Chao Yu <yuchao0@huawei.com> | 2018-05-28 16:59:27 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-05-31 11:31:52 -0700 |
commit | 14a28559f43ac7c0b98dd1b0e73ec9ec8ab4fc45 (patch) | |
tree | 91fe3903a54c153e82cb2af013bd496723162173 /fs/f2fs | |
parent | 1174abfd8309f4c47d454734233aa3b694560e10 (diff) | |
download | linux-14a28559f43ac7c0b98dd1b0e73ec9ec8ab4fc45.tar.bz2 |
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')
-rw-r--r-- | fs/f2fs/gc.c | 11 |
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: |