summaryrefslogtreecommitdiffstats
path: root/mm/truncate.c
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2006-12-22 01:04:48 -0800
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-22 08:55:45 -0800
commit5f2a105d5e33a038a717995d2738434f9c25aed2 (patch)
tree4d72272dfaa5eb00f96ff895ca72bdfd97fa4bdc /mm/truncate.c
parentbb4067e34159648d394943d5e2a011f838bff22f (diff)
downloadlinux-5f2a105d5e33a038a717995d2738434f9c25aed2.tar.gz
linux-5f2a105d5e33a038a717995d2738434f9c25aed2.tar.bz2
linux-5f2a105d5e33a038a717995d2738434f9c25aed2.zip
[PATCH] truncate: dirty memory accounting fix
Only (un)account for IO and page-dirtying for devices which have real backing store (ie: not tmpfs or ramdisks). Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/truncate.c')
-rw-r--r--mm/truncate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/truncate.c b/mm/truncate.c
index 89a5c359b6e8..4a38dd1a4ce8 100644
--- a/mm/truncate.c
+++ b/mm/truncate.c
@@ -60,7 +60,8 @@ void cancel_dirty_page(struct page *page, unsigned int account_size)
WARN_ON(++warncount < 5);
}
- if (TestClearPageDirty(page) && account_size) {
+ if (TestClearPageDirty(page) && account_size &&
+ mapping_cap_account_dirty(page->mapping)) {
dec_zone_page_state(page, NR_FILE_DIRTY);
task_io_account_cancelled_write(account_size);
}