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 <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>
1 parent 64bf0ee commit 61285ff

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

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)