From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B1FE20DD51; Mon, 4 May 2026 13:56:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777903000; cv=none; b=Uu5Fk+78byzZhgubVbJb0CG5oYdS772PDlAdJmUmu0NMdX8Nzl4h1943NTtMUYRftHG+WbNhq8x2C3FUvL4myqZKyBvis/vgdfqFmpkwE/mhXeKACJ43VuUpSVQiKlqQNSDJZPvIlF8h1isi33Yt6OHkmj7M3LB5QDCmVXVitXY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777903000; c=relaxed/simple; bh=IEm8jtAVZ2NahXLWtVu7uUYGeMCISo6iH+J9I9yrKu8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gFd4KjuUY7GINa2AfNXtu+2NWemR7ihf0TzQdCQ203xavXfPCmWPPCHpd/Jl4Y8xT3Vgc8scSS+d9lU+4qqevR3Jb9LHZbpmCoy9dWiGA6s0U03MZ4X4mbjdtVXa1RDvmIQeZcUKqGIu3oEHm70WinWfenGa0E7Y03Pn8IQujnY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=STsVornA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="STsVornA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 689FEC2BCB8; Mon, 4 May 2026 13:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777902999; bh=IEm8jtAVZ2NahXLWtVu7uUYGeMCISo6iH+J9I9yrKu8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=STsVornAp5TidwVxhVNlULXhNZ2PLNN4Wr4i2khY0X+t6b/aGKNi54V6DCx/lGzpD ra+rVLr5EO8D5VMRsoZUS4KOu3xO9os55Ft3AyWwhMRFKYGDyLa0afxX9RIbf+J9mt erfstRs46RXApHcAmEYD2DTwwiyeeEw+uffLKMpI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Sergey Senozhatsky , Qu Wenruo , Avinesh Kumar , Christoph Hellwig , Brian Geffon , Jens Axboe , Minchan Kim , Andrew Morton Subject: [PATCH 7.0 032/307] zram: do not forget to endio for partial discard requests Date: Mon, 4 May 2026 15:48:37 +0200 Message-ID: <20260504135144.038173677@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504135142.814938198@linuxfoundation.org> References: <20260504135142.814938198@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sergey Senozhatsky commit e3668b371329ea036ff022ce8ecc82f8befcf003 upstream. As reported by Qu Wenruo and Avinesh Kumar, 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 jumping to end_bio label, which does bio_endio(). Link: https://lore.kernel.org/20260331074255.777019-1-senozhatsky@chromium.org Fixes: 0120dd6e4e20 ("zram: make zram_bio_discard more self-contained") Signed-off-by: Sergey Senozhatsky Reported-by: Qu Wenruo Closes: https://lore.kernel.org/linux-block/92361cd3-fb8b-482e-bc89-15ff1acb9a59@suse.com Tested-by: Qu Wenruo Reported-by: Avinesh Kumar Closes: https://bugzilla.suse.com/show_bug.cgi?id=1256530 Reviewed-by: Christoph Hellwig Cc: Brian Geffon Cc: Jens Axboe Cc: Minchan Kim Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/block/zram/zram_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -2697,7 +2697,7 @@ static void zram_bio_discard(struct zram */ if (offset) { if (n <= (PAGE_SIZE - offset)) - return; + goto end_bio; n -= (PAGE_SIZE - offset); index++; @@ -2712,6 +2712,7 @@ static void zram_bio_discard(struct zram n -= PAGE_SIZE; } +end_bio: bio_endio(bio); }