summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <chao2.yu@samsung.com>2014-02-28 03:12:05 +0100
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2014-02-28 05:09:08 +0100
commit9cf3c3898a274ca637b88ad01b0830550ee2d318 (patch)
treeb0cdb47c4dde8ed7a3e5463e0bc3e8bc10979355 /fs/f2fs
parentf2fs: use existing macro to clean up some codes (diff)
downloadlinux-9cf3c3898a274ca637b88ad01b0830550ee2d318.tar.xz
linux-9cf3c3898a274ca637b88ad01b0830550ee2d318.zip
f2fs: fix dirty page accounting when redirty
We should de-account dirty counters for page when redirty in ->writepage(). Wu Fengguang described in 'commit 971767caf632190f77a40b4011c19948232eed75': "writeback: fix dirtied pages accounting on redirty De-account the accumulative dirty counters on page redirty. Page redirties (very common in ext4) will introduce mismatch between counters (a) and (b) a) NR_DIRTIED, BDI_DIRTIED, tsk->nr_dirtied b) NR_WRITTEN, BDI_WRITTEN This will introduce systematic errors in balanced_rate and result in dirty page position errors (ie. the dirty pages are no longer balanced around the global/bdi setpoints)." Signed-off-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/checkpoint.c1
-rw-r--r--fs/f2fs/data.c1
-rw-r--r--fs/f2fs/node.c1
3 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index c8516ee24126..f069249011b2 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -178,6 +178,7 @@ no_write:
redirty_out:
dec_page_count(sbi, F2FS_DIRTY_META);
wbc->pages_skipped++;
+ account_page_redirty(page);
set_page_dirty(page);
return AOP_WRITEPAGE_ACTIVATE;
}
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 93d80ea4674b..101b4cd4170d 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -839,6 +839,7 @@ out:
redirty_out:
wbc->pages_skipped++;
+ account_page_redirty(page);
set_page_dirty(page);
return AOP_WRITEPAGE_ACTIVATE;
}
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 1f9cf2148816..8c1411060e7e 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1193,6 +1193,7 @@ static int f2fs_write_node_page(struct page *page,
redirty_out:
dec_page_count(sbi, F2FS_DIRTY_NODES);
wbc->pages_skipped++;
+ account_page_redirty(page);
set_page_dirty(page);
return AOP_WRITEPAGE_ACTIVATE;
}