summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-03-19 13:55:17 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-04-01 15:58:29 -0700
commit0b4d9d6ac1f1d22fb0342305cd1e9bf67307d194 (patch)
treee2412e761ba7a478ceaad6cb1784db40579b7aca /fs/nfs
parent619338378356905f8a9ca6fdf94097389328f4f0 (diff)
NFS: Prevent another deadlock in nfs_release_page()
commit d812e575822a2b7ab1a7cadae2571505ec6ec2bd upstream. We should not attempt to free the page if __GFP_FS is not set. Otherwise we can deadlock as per http://bugzilla.kernel.org/show_bug.cgi?id=15578 Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/file.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 393d40fd7eb9..61b3bf503ee1 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -486,7 +486,8 @@ static int nfs_release_page(struct page *page, gfp_t gfp)
{
dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page);
- if (gfp & __GFP_WAIT)
+ /* Only do I/O if gfp is a superset of GFP_KERNEL */
+ if ((gfp & GFP_KERNEL) == GFP_KERNEL)
nfs_wb_page(page->mapping->host, page);
/* If PagePrivate() is set, then the page is not freeable */
if (PagePrivate(page))