Skip to content

Commit 61285ff

Browse files
Christoph Hellwigaxboe
authored andcommitted
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: 77c436d ("mpage: pass the operation to bio_alloc") Reported-by: Guenter Roeck <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Tested-by: Ryusuke Konishi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 64bf0ee commit 61285ff

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

fs/mpage.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,11 @@ static struct bio *do_mpage_readpage(struct mpage_readpage_args *args)
148148
int op = REQ_OP_READ;
149149
unsigned nblocks;
150150
unsigned relative_block;
151-
gfp_t gfp;
151+
gfp_t gfp = mapping_gfp_constraint(page->mapping, GFP_KERNEL);
152152

153153
if (args->is_readahead) {
154154
op |= REQ_RAHEAD;
155-
gfp = readahead_gfp_mask(page->mapping);
156-
} else {
157-
gfp = mapping_gfp_constraint(page->mapping, GFP_KERNEL);
155+
gfp |= __GFP_NORETRY | __GFP_NOWARN;
158156
}
159157

160158
if (page_has_buffers(page))

0 commit comments

Comments
 (0)