aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-22 16:32:08 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-22 16:32:08 -0700
commit1ed73535789d5558f91d214e089a659ab59ae80f (patch)
treebdee2ad5b4b870f8695519be8c0a4dac716ad966 /mm
parent8a51beef39cfd11a4f0ba850813cd99c5adac2c3 (diff)
downloadhistory-1ed73535789d5558f91d214e089a659ab59ae80f.tar.gz
[PATCH] writeback livelock fix
If a filesystem's ->writepage implementation repeatedly refuses to write the page (it keeps on redirtying it instead) (reiserfs seems to do this) then the writeback logic can get stuck repeately trying to write the same page. Fix that up by correctly setting wbc->pages_skipped, to tell the writeback logic that things aren't working out.
Diffstat (limited to 'mm')
-rw-r--r--mm/page-writeback.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 22e17333982a9f..042ccadd85040d 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -580,6 +580,18 @@ int __set_page_dirty_nobuffers(struct page *page)
EXPORT_SYMBOL(__set_page_dirty_nobuffers);
/*
+ * When a writepage implementation decides that it doesn't want to write this
+ * page for some reason, it should redirty the locked page via
+ * redirty_page_for_writepage() and it should then unlock the page and return 0
+ */
+int redirty_page_for_writepage(struct writeback_control *wbc, struct page *page)
+{
+ wbc->pages_skipped++;
+ return __set_page_dirty_nobuffers(page);
+}
+EXPORT_SYMBOL(redirty_page_for_writepage);
+
+/*
* If the mapping doesn't provide a set_page_dirty a_op, then
* just fall through and assume that it wants buffer_heads.
*/