public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Sergey Senozhatsky <senozhatsky@chromium.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Minchan Kim <minchan@kernel.org>,
	Brian Geffon <bgeffon@google.com>,
	linux-block@vger.kernel.org, linux-mm@kvack.org,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v2] zram: do not forget to endio for partial discard requests
Date: Tue, 31 Mar 2026 18:10:08 +1030	[thread overview]
Message-ID: <c2a593e1-cbde-46bb-a32a-c9db38c62801@suse.com> (raw)
In-Reply-To: <20260331073737.774503-1-senozhatsky@chromium.org>



在 2026/3/31 18:05, Sergey Senozhatsky 写道:
> As reported by Qu Wenruo, the following
> 
>   getconf PAGESIZE
>   65536
>   blkdiscard -p 4k /dev/zram0
> 
> takes literally forever to complete.  zram doesn't support
> partial discards and just returns immediately w/o doing any
> discard work in such cases.  The problem is that we forget
> to endio on our way out, so blkdiscard sleeps forever in
> submit_bio_wait().  Fix this by adding a missing bio_endio()
> call.
> 
> Fixes: 0120dd6e4e202 ("zram: make zram_bio_discard more self-contained")
> Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
> Reported-by: Qu Wenruo <wqu@suse.com>
> Closes: https://lore.kernel.org/linux-block/92361cd3-fb8b-482e-bc89-15ff1acb9a59@suse.com
> Test-by: Qu Wenruo <wqu@suse.com>
> Cc: Christoph Hellwig <hch@lst.de>


And forgot to mention, I'm just a messenger who also did the triage.

The original reporter is Avinesh Kumar <avinesh.kumar@suse.com>, who 
noticed a test failure from LTP runs.

The detailed public bugzilla can be found here:

https://bugzilla.suse.com/show_bug.cgi?id=1256530

Thanks,
Qu

> ---
> 
> v1->v2:
> - use goto end_bio (Christoph)
> 
>   drivers/block/zram/zram_drv.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
> index dcea703a6766..aca67d7144e4 100644
> --- a/drivers/block/zram/zram_drv.c
> +++ b/drivers/block/zram/zram_drv.c
> @@ -2684,7 +2684,7 @@ static void zram_bio_discard(struct zram *zram, struct bio *bio)
>   	 */
>   	if (offset) {
>   		if (n <= (PAGE_SIZE - offset))
> -			return;
> +			goto end_bio;
>   
>   		n -= (PAGE_SIZE - offset);
>   		index++;
> @@ -2699,6 +2699,7 @@ static void zram_bio_discard(struct zram *zram, struct bio *bio)
>   		n -= PAGE_SIZE;
>   	}
>   
> +end_bio:
>   	bio_endio(bio);
>   }
>   



  reply	other threads:[~2026-03-31  7:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-31  7:35 [PATCH v2] zram: do not forget to endio for partial discard requests Sergey Senozhatsky
2026-03-31  7:40 ` Qu Wenruo [this message]
2026-03-31  7:43   ` Sergey Senozhatsky
2026-03-31  7:40 ` Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c2a593e1-cbde-46bb-a32a-c9db38c62801@suse.com \
    --to=wqu@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=bgeffon@google.com \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=senozhatsky@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox