aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-03-13 04:49:22 -0400
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-03-20 05:30:12 -0400
commit08d8058be6d11bd81f2ed75fc0ecdf55b7685655 (patch)
tree3fbc2348de9055420a92b6c7171a97f457a16965
parent393ff91f57c87d48ffed30878be6e3e486d3a00a (diff)
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: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
-rw-r--r--fs/f2fs/node.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 9e6ed6708fa8..90221cc7247c 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1097,13 +1097,6 @@ static int f2fs_write_node_page(struct page *page,
1097 block_t new_addr; 1097 block_t new_addr;
1098 struct node_info ni; 1098 struct node_info ni;
1099 1099
1100 if (wbc->for_reclaim) {
1101 dec_page_count(sbi, F2FS_DIRTY_NODES);
1102 wbc->pages_skipped++;
1103 set_page_dirty(page);
1104 return AOP_WRITEPAGE_ACTIVATE;
1105 }
1106
1107 wait_on_page_writeback(page); 1100 wait_on_page_writeback(page);
1108 1101
1109 mutex_lock_op(sbi, NODE_WRITE); 1102 mutex_lock_op(sbi, NODE_WRITE);
@@ -1118,6 +1111,14 @@ static int f2fs_write_node_page(struct page *page,
1118 if (ni.blk_addr == NULL_ADDR) 1111 if (ni.blk_addr == NULL_ADDR)
1119 goto out; 1112 goto out;
1120 1113
1114 if (wbc->for_reclaim) {
1115 dec_page_count(sbi, F2FS_DIRTY_NODES);
1116 wbc->pages_skipped++;
1117 set_page_dirty(page);
1118 mutex_unlock_op(sbi, NODE_WRITE);
1119 return AOP_WRITEPAGE_ACTIVATE;
1120 }
1121
1121 set_page_writeback(page); 1122 set_page_writeback(page);
1122 1123
1123 /* insert node offset */ 1124 /* insert node offset */