summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/node.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-03-13 17:45:15 +0900
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-03-18 21:00:09 +0900
commit12faafe45477244bc32e2c58f74f7305cc7e84fa (patch)
tree6c21e51f3e1471e3182482e7d060be3cb79ecbc6 /fs/f2fs/node.c
parent12fc760fd632a96f49e96f519c4aed4eb279bb61 (diff)
downloadblackbird-op-linux-12faafe45477244bc32e2c58f74f7305cc7e84fa.tar.gz
blackbird-op-linux-12faafe45477244bc32e2c58f74f7305cc7e84fa.zip
f2fs: fix to unlock node page when it was truncated
If the node page was truncated, its block address became zero. This means that we don't need to write the node page, but have to unlock NODE_WRITE, decrease the number of dirty node pages, and then unlock_page before returning the f2fs_write_node_page with zero. Reviewed-by: Namjae Jeon <namjae.jeon@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r--fs/f2fs/node.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index e275218904ed..3dc63f4cf2b1 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1106,15 +1106,15 @@ static int f2fs_write_node_page(struct page *page,
/* This page is already truncated */
if (ni.blk_addr == NULL_ADDR)
- return 0;
+ goto out;
set_page_writeback(page);
/* insert node offset */
write_node_page(sbi, page, nid, ni.blk_addr, &new_addr);
set_node_addr(sbi, &ni, new_addr);
+out:
dec_page_count(sbi, F2FS_DIRTY_NODES);
-
mutex_unlock_op(sbi, NODE_WRITE);
unlock_page(page);
return 0;
OpenPOWER on IntegriCloud