Commit 08d8058b authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: should check the node page was truncated first

Currently, f2fs doesn't reclaim any node pages.
However, if we found that a node page was truncated by checking its block
address with zero during f2fs_write_node_page, we should not skip that node
page and return zero to reclaim it.
Reviewed-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 393ff91f
...@@ -1097,13 +1097,6 @@ static int f2fs_write_node_page(struct page *page, ...@@ -1097,13 +1097,6 @@ static int f2fs_write_node_page(struct page *page,
block_t new_addr; block_t new_addr;
struct node_info ni; struct node_info ni;
if (wbc->for_reclaim) {
dec_page_count(sbi, F2FS_DIRTY_NODES);
wbc->pages_skipped++;
set_page_dirty(page);
return AOP_WRITEPAGE_ACTIVATE;
}
wait_on_page_writeback(page); wait_on_page_writeback(page);
mutex_lock_op(sbi, NODE_WRITE); mutex_lock_op(sbi, NODE_WRITE);
...@@ -1118,6 +1111,14 @@ static int f2fs_write_node_page(struct page *page, ...@@ -1118,6 +1111,14 @@ static int f2fs_write_node_page(struct page *page,
if (ni.blk_addr == NULL_ADDR) if (ni.blk_addr == NULL_ADDR)
goto out; goto out;
if (wbc->for_reclaim) {
dec_page_count(sbi, F2FS_DIRTY_NODES);
wbc->pages_skipped++;
set_page_dirty(page);
mutex_unlock_op(sbi, NODE_WRITE);
return AOP_WRITEPAGE_ACTIVATE;
}
set_page_writeback(page); set_page_writeback(page);
/* insert node offset */ /* insert node offset */
......
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