Re: [PATCH] block: fix bio_alloc_bioset slowpath GFP handling

From: Jens Axboe

Date: Mon Mar 23 2026 - 10:06:10 EST



On Sun, 22 Mar 2026 03:35:10 +0100, Vasily Gorbik wrote:
> bio_alloc_bioset() first strips __GFP_DIRECT_RECLAIM from the optimistic
> fast allocation attempt with try_alloc_gfp(). If that fast path fails,
> the slowpath checks saved_gfp to decide whether blocking allocation is
> allowed, but then still calls mempool_alloc() with the stripped gfp mask.
> That can lead to a NULL bio pointer being passed into bio_init().
>
> Fix the slowpath by using saved_gfp for the bio and bvec mempool
> allocations.
>
> [...]

Applied, thanks!

[1/1] block: fix bio_alloc_bioset slowpath GFP handling
commit: 67807fbaf12719fca46a622d759484652b79c7c3

Best regards,
--
Jens Axboe