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