Commit 5241cac5 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix nfs writepage behaviour

From: Nick Piggin <nickpiggin@yahoo.com.au>

nfs_writepage() refuses to write back mapped pages at all on the page
reclaim path, causing systems to get locked up when there's a lot of dirty
mmapped data around.  The patch changes NFS so that it will start I/O
against these pages.

The code as it stands is designed to defer writeout to pdflush which can do
larger, more efficient I/Os.  But there shouldn't be much traffic by this
path, and going slow is better than not going at all.

Patch originally from Trond.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent dca8ede4
...@@ -314,7 +314,7 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc) ...@@ -314,7 +314,7 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
if (err >= 0) { if (err >= 0) {
err = 0; err = 0;
if (wbc->for_reclaim) if (wbc->for_reclaim)
err = WRITEPAGE_ACTIVATE; nfs_flush_inode(inode, 0, 0, FLUSH_STABLE);
} }
} else { } else {
err = nfs_writepage_sync(NULL, inode, page, 0, err = nfs_writepage_sync(NULL, inode, page, 0,
...@@ -327,8 +327,7 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc) ...@@ -327,8 +327,7 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc)
} }
unlock_kernel(); unlock_kernel();
out: out:
if (err != WRITEPAGE_ACTIVATE) unlock_page(page);
unlock_page(page);
if (inode_referenced) if (inode_referenced)
iput(inode); iput(inode);
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment