[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-id: <1363585889-8286-1-git-send-email-jaegeuk.kim@samsung.com>
Date: Mon, 18 Mar 2013 14:51:29 +0900
From: Jaegeuk Kim <jaegeuk.kim@...sung.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Jaegeuk Kim <jaegeuk.kim@...sung.com>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net
Subject: [PATCH] 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.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@...sung.com>
---
fs/f2fs/node.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 9e6ed67..90221cc 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1097,13 +1097,6 @@ static int f2fs_write_node_page(struct page *page,
block_t new_addr;
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);
mutex_lock_op(sbi, NODE_WRITE);
@@ -1118,6 +1111,14 @@ static int f2fs_write_node_page(struct page *page,
if (ni.blk_addr == NULL_ADDR)
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);
/* insert node offset */
--
1.8.1.3.566.gaa39828
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists