1 From 4cd13504652d28e16bf186c6bb2bbb3725369383 Mon Sep 17 00:00:00 2001
2 From: Hugh Dickins <hugh@veritas.com>
3 Date: Thu, 3 Apr 2008 23:35:22 +0100
4 Subject: [PATCH] splice: use mapping_gfp_mask
6 The loop block driver is careful to mask __GFP_IO|__GFP_FS out of its
7 mapping_gfp_mask, to avoid hangs under memory pressure. But nowadays
8 it uses splice, usually going through __generic_file_splice_read. That
9 must use mapping_gfp_mask instead of GFP_KERNEL to avoid those hangs.
11 Signed-off-by: Hugh Dickins <hugh@veritas.com>
12 Cc: Jens Axboe <jens.axboe@oracle.com>
13 Cc: Andrew Morton <akpm@linux-foundation.org>
14 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15 Signed-off-by: Oliver Pinter <oliver.pntr@gmail.com>
17 diff --git a/fs/splice.c b/fs/splice.c
18 index 0670c91..a861bb3 100644
21 @@ -320,7 +320,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
24 error = add_to_page_cache_lru(page, mapping, index,
26 + mapping_gfp_mask(mapping));
27 if (unlikely(error)) {
28 page_cache_release(page);