summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorDave Kleikamp <dave.kleikamp@oracle.com>2011-12-21 11:05:48 -0600
committerRohan Somvanshi <rsomvanshi@nvidia.com>2012-01-11 10:07:42 -0800
commit3b3a0ffeb47124ac896898f900e9855523b977b3 (patch)
tree646612f8a5213a1e6690e1c38bd42669544e8aad /mm
parent1b5f5e5c988baf2656f2e84de0700840c0912842 (diff)
vfs: __read_cache_page should use gfp argument rather than GFP_KERNEL
commit e6f67b8c05f5e129e126f4409ddac6f25f58ffcb upstream. lockdep reports a deadlock in jfs because a special inode's rw semaphore is taken recursively. The mapping's gfp mask is GFP_NOFS, but is not used when __read_cache_page() calls add_to_page_cache_lru(). Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com> Acked-by: Hugh Dickins <hughd@google.com> Acked-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Change-Id: I200c86387cc650dbfb33c8a22ae943ed6996648a Reviewed-on: http://git-master/r/74187 Reviewed-by: Varun Wadekar <vwadekar@nvidia.com> Tested-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index 7771871fa353..b91f3aa627fc 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1828,7 +1828,7 @@ repeat:
page = __page_cache_alloc(gfp | __GFP_COLD);
if (!page)
return ERR_PTR(-ENOMEM);
- err = add_to_page_cache_lru(page, mapping, index, GFP_KERNEL);
+ err = add_to_page_cache_lru(page, mapping, index, gfp);
if (unlikely(err)) {
page_cache_release(page);
if (err == -EEXIST)
@@ -1925,10 +1925,7 @@ static struct page *wait_on_page_read(struct page *page)
* @gfp: the page allocator flags to use if allocating
*
* This is the same as "read_mapping_page(mapping, index, NULL)", but with
- * any new page allocations done using the specified allocation flags. Note
- * that the Radix tree operations will still use GFP_KERNEL, so you can't
- * expect to do this atomically or anything like that - but you can pass in
- * other page requirements.
+ * any new page allocations done using the specified allocation flags.
*
* If the page does not get brought uptodate, return -EIO.
*/