diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-19 13:55:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 19:01:33 -0400 |
commit | 7823ec3aa5ba160848974fc37a82ccf524d7ea9c (patch) | |
tree | cc29134b13332ffbe53ac0d7daee8baf76175f78 /fs/nfs | |
parent | 0a06efd61cec31c4a8b4833bb56c916a1dacb41e (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.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 63f2071d6445..bdd2142c1b3b 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) | |||
486 | { | 486 | { |
487 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); | 487 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); |
488 | 488 | ||
489 | if (gfp & __GFP_WAIT) | 489 | /* Only do I/O if gfp is a superset of GFP_KERNEL */ |
490 | if ((gfp & GFP_KERNEL) == GFP_KERNEL) | ||
490 | nfs_wb_page(page->mapping->host, page); | 491 | nfs_wb_page(page->mapping->host, page); |
491 | /* If PagePrivate() is set, then the page is not freeable */ | 492 | /* If PagePrivate() is set, then the page is not freeable */ |
492 | if (PagePrivate(page)) | 493 | if (PagePrivate(page)) |