From: Trond Myklebust Date: Tue, 5 Dec 2006 05:35:42 +0000 (-0500) Subject: NFS: Fix nfs_release_page X-Git-Tag: v2.6.20-rc1~34^2~412^2~37 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=fa8d8c5b77a2dc467b5365a5651710161b84f16d;p=linux-2.6-omap-h63xx.git NFS: Fix nfs_release_page invalidate_inode_pages2_range() will clear the PG_dirty bit before calling try_to_release_page(). Signed-off-by: Trond Myklebust --- diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 238fb6641aa..8e28bffc35a 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -315,13 +315,14 @@ static void nfs_invalidate_page(struct page *page, unsigned long offset) static int nfs_release_page(struct page *page, gfp_t gfp) { - if (gfp & __GFP_FS) - return !nfs_wb_page(page->mapping->host, page); - else - /* - * Avoid deadlock on nfs_wait_on_request(). - */ + /* + * Avoid deadlock on nfs_wait_on_request(). + */ + if (!(gfp & __GFP_FS)) return 0; + /* Hack... Force nfs_wb_page() to write out the page */ + SetPageDirty(page); + return !nfs_wb_page(page->mapping->host, page); } const struct address_space_operations nfs_file_aops = {