From: Christoph Hellwig Date: Wed, 23 Mar 2022 15:39:52 +0000 (+0100) Subject: fs: do not pass __GFP_HIGHMEM to bio_alloc in do_mpage_readpage X-Git-Tag: v5.18-rc1~102^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61285ff72ae59e1603f908b13363e99883d67e09;p=thirdparty%2Fkernel%2Flinux.git fs: do not pass __GFP_HIGHMEM to bio_alloc in do_mpage_readpage The mpage bio alloc cleanup accidentally removed clearing ~GFP_KERNEL bits from the mask passed to bio_alloc. Fix this up in a slightly less obsfucated way that mirrors what iomap does in its readpage code. Fixes: 77c436de01c0 ("mpage: pass the operation to bio_alloc") Reported-by: Guenter Roeck Signed-off-by: Christoph Hellwig Tested-by: Ryusuke Konishi Link: https://lore.kernel.org/r/20220323153952.1418560-1-hch@lst.de Signed-off-by: Jens Axboe --- diff --git a/fs/mpage.c b/fs/mpage.c index 6c4b810a21d0a..2492b30192c00 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -148,13 +148,11 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args) int op = REQ_OP_READ; unsigned nblocks; unsigned relative_block; - gfp_t gfp; + gfp_t gfp = mapping_gfp_constraint(page->mapping, GFP_KERNEL); if (args->is_readahead) { op |= REQ_RAHEAD; - gfp = readahead_gfp_mask(page->mapping); - } else { - gfp = mapping_gfp_constraint(page->mapping, GFP_KERNEL); + gfp |= __GFP_NORETRY | __GFP_NOWARN; } if (page_has_buffers(page))