Re: [PATCH 2/4] zram: call bio_endio() on early return in zram_bio_discard()

From: Sergey Senozhatsky

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


On (26/04/07 08:38), Andrew Stellman wrote:
> drivers/block/zram/zram_drv.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index f41f1ca..8ea2a12 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -2701,8 +2701,10 @@ static void zram_bio_discard(struct zram *zram, struct bio *bio)
> * skipping this logical block is appropriate here.
> */
> if (offset) {
> - if (n <= (PAGE_SIZE - offset))
> + if (n <= (PAGE_SIZE - offset)) {
> + bio_endio(bio);
> return;
> + }
>
> n -= (PAGE_SIZE - offset);
> index++;

This is already fixed.