Skip to contentSkip to conversation

fs: do not pass __GFP_HIGHMEM to bio_alloc in do_mpage_readpage

PATCH Applied Christoph Hellwig 2 participants 2 messages Mar 23, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 fs/mpage.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/mpage.c +2 -4
index 9ed1e58e8d70b..d465883edf719 100644
@@ -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))
Signature · 1 line
2.30.2
maintainer Applied
#1 lore raw
Quoted 5 lines · Christoph Hellwig

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.

Applied, thanks!

[1/1] fs: do not pass __GFP_HIGHMEM to bio_alloc in do_mpage_readpage

      commit: 61285ff72ae59e1603f908b13363e99883d67e09

Best regards,

Signature · 1 line
Jens Axboe