Skip to content

Commit

Permalink
[PATCH] truncate: dirty memory accounting fix
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Dec 22, 2006
1 parent bb4067e commit 5f2a105
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm/truncate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 5f2a105

Please sign in to comment.