diff options
author | Chao Yu <yuchao0@huawei.com> | 2018-05-28 11:59:27 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-03 08:47:39 +0300 |
commit | df44c0553defe56dfa1113d5712bfa2c8b305f05 (patch) | |
tree | 3974776bb03dcae2e8ea7cceb6869f3b644c4059 /fs/f2fs | |
parent | ac3db8cb962cf81254de955f374ad5d2085dea56 (diff) | |
download | linux-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.c | 11 |
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: |