Re: [PATCH 1/4] zram: complete parent bio on allocation failure in read_from_bdev_async()

From: Sergey Senozhatsky

Date: Tue Apr 07 2026 - 10:24:18 EST


On (26/04/07 08:38), Andrew Stellman wrote:
> drivers/block/zram/zram_drv.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index af67937..f41f1ca 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -1437,12 +1437,17 @@ static void read_from_bdev_async(struct zram *zram, struct page *page,
> struct bio *bio;
>
> req = kmalloc_obj(*req, GFP_NOIO);
> - if (!req)
> + if (!req) {
> + parent->bi_status = BLK_STS_IOERR;
> + bio_endio(parent);
> return;
> + }
>
> bio = bio_alloc(zram->bdev, 1, parent->bi_opf, GFP_NOIO);
> if (!bio) {
> kfree(req);
> + parent->bi_status = BLK_STS_IOERR;
> + bio_endio(parent);
> return;
> }

This is already fixed.