X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=mm%2Ffilemap.c;h=f4d0cded0e10aa21b02707fcaf99c4cbcafa4f06;hb=b6b8abe4ddec2cfb3471ea60f965a137cd4d529d;hp=188cf5fd3e8d4acedec4e74c05375238526506e5;hpb=aac9e28d2f3d3c1eacc4114d685864a2a6423b80;p=linux-2.6-omap-h63xx.git diff --git a/mm/filemap.c b/mm/filemap.c index 188cf5fd3e8..f4d0cded0e1 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -124,6 +124,18 @@ void __remove_from_page_cache(struct page *page) mapping->nrpages--; __dec_zone_page_state(page, NR_FILE_PAGES); BUG_ON(page_mapped(page)); + + /* + * Some filesystems seem to re-dirty the page even after + * the VM has canceled the dirty bit (eg ext3 journaling). + * + * Fix it up by doing a final dirty accounting check after + * having removed the page entirely. + */ + if (PageDirty(page) && mapping_cap_account_dirty(mapping)) { + dec_zone_page_state(page, NR_FILE_DIRTY); + dec_bdi_stat(mapping->backing_dev_info, BDI_RECLAIMABLE); + } } void remove_from_page_cache(struct page *page)