Skip to content

Commit

Permalink
vfs: __read_cache_page should use gfp argument rather than GFP_KERNEL
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Hugh Dickins <[email protected]>
Acked-by: Al Viro <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
kleikamp authored and torvalds committed Dec 22, 2011
1 parent 7b21a20 commit e6f67b8
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1828,7 +1828,7 @@ static struct page *__read_cache_page(struct address_space *mapping,
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)
Expand Down Expand Up @@ -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.
*/
Expand Down

0 comments on commit e6f67b8

Please sign in to comment.