aboutsummaryrefslogtreecommitdiffstats
path: root/mm/filemap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/filemap.c')
-rw-r--r--mm/filemap.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 876f4e6f3ed6..12548d03c11d 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -202,16 +202,15 @@ void __delete_from_page_cache(struct page *page, void *shadow)
202 BUG_ON(page_mapped(page)); 202 BUG_ON(page_mapped(page));
203 203
204 /* 204 /*
205 * Some filesystems seem to re-dirty the page even after 205 * At this point page must be either written or cleaned by truncate.
206 * the VM has canceled the dirty bit (eg ext3 journaling). 206 * Dirty page here signals a bug and loss of unwritten data.
207 * 207 *
208 * Fix it up by doing a final dirty accounting check after 208 * This fixes dirty accounting after removing the page entirely but
209 * having removed the page entirely. 209 * leaves PageDirty set: it has no effect for truncated page and
210 * anyway will be cleared before returning page into buddy allocator.
210 */ 211 */
211 if (PageDirty(page) && mapping_cap_account_dirty(mapping)) { 212 if (WARN_ON_ONCE(PageDirty(page)))
212 dec_zone_page_state(page, NR_FILE_DIRTY); 213 account_page_cleaned(page, mapping);
213 dec_bdi_stat(inode_to_bdi(mapping->host), BDI_RECLAIMABLE);
214 }
215} 214}
216 215
217/** 216/**