Commit 14a28559 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

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: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 1174abfd
...@@ -780,9 +780,14 @@ static void move_data_page(struct inode *inode, block_t bidx, int gc_type, ...@@ -780,9 +780,14 @@ static void move_data_page(struct inode *inode, block_t bidx, int gc_type,
set_cold_data(page); set_cold_data(page);
err = do_write_data_page(&fio); err = do_write_data_page(&fio);
if (err == -ENOMEM && is_dirty) { if (err) {
congestion_wait(BLK_RW_ASYNC, HZ/50); clear_cold_data(page);
goto retry; if (err == -ENOMEM) {
congestion_wait(BLK_RW_ASYNC, HZ/50);
goto retry;
}
if (is_dirty)
set_page_dirty(page);
} }
} }
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment