v2.6.22.22-op2-rc1
[linux-2.6.22.y-op-patches.git] / release-2.6.22.y / 2.6.22.22-op1 / splice-use-mapping_gfp_mask.patch
blob18a118d43fd04683720510204eea3c73ab8d63c8
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
19 --- a/fs/splice.c
20 +++ b/fs/splice.c
21 @@ -320,7 +320,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
22 break;
24 error = add_to_page_cache_lru(page, mapping, index,
25 - GFP_KERNEL);
26 + mapping_gfp_mask(mapping));
27 if (unlikely(error)) {
28 page_cache_release(page);
29 if (error == -EEXIST)