Skip to content

Commit

Permalink
fs: do not pass __GFP_HIGHMEM to bio_alloc in do_mpage_readpage
Browse files Browse the repository at this point in the history
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 <linux@roeck-us.net>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Tested-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Link: https://lore.kernel.org/r/20220323153952.1418560-1-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Mar 23, 2022
1 parent 64bf0ee commit 61285ff
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/mpage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 61285ff

Please sign in to comment.