]> git.hungrycats.org Git - linux/commitdiff
splice: use mapping_gfp_mask
authorHugh Dickins <hugh@veritas.com>
Thu, 3 Apr 2008 22:35:22 +0000 (23:35 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 May 2008 21:48:58 +0000 (14:48 -0700)
upstream commit: 4cd13504652d28e16bf186c6bb2bbb3725369383

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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
fs/splice.c

index e3134783806f5e0b4e77669e84206896068a29ae..109153c05d12d1cbf39c16bf3c35c3259e37ab89 100644 (file)
@@ -314,7 +314,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)