Skip to content

Commit

Permalink
splice: use mapping_gfp_mask
Browse files Browse the repository at this point in the history
The loop block driver is careful to mask __GFP_IO|__GFP_FS out of its
mapping_gfp_mask, to avoid hangs under memory pressure.  But nowadays
it uses splice, usually going through __generic_file_splice_read.  That
must use mapping_gfp_mask instead of GFP_KERNEL to avoid those hangs.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Apr 3, 2008
1 parent 9597362 commit 4cd1350
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
break;

error = add_to_page_cache_lru(page, mapping, index,
GFP_KERNEL);
mapping_gfp_mask(mapping));
if (unlikely(error)) {
page_cache_release(page);
if (error == -EEXIST)
Expand Down

0 comments on commit 4cd1350

Please sign in to comment.