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 B37D33DE43C; Mon, 4 May 2026 14:20:29 +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=1777904429; cv=none; b=lZjxPC2PV6RGCurHxCYhGq59tRDyJo7Kjf9e1zV6BpZlSCIo5qqIdtPqVou800MRY7pU4Y4LiXiz/MEXIl+Z4Vb4ASnRyyQX72kkXmBiB+L8A2GsqKMOwUSqh9jMwgwoUTDKjfp/l4QQCcUGPKyGXweecHOcDgHMRMfvfdpoHj4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777904429; c=relaxed/simple; bh=Qw1xDlb6MAPFvHZvXe3bn/LTwdKZw3KvuvqWUEvC9CY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WN88Or4ZncuSYeAZUUuZYKo+P3ikbssTNOEMybiZSMODeHko29jsWUOftWpSlDB99NWCsKL/tWLWaASVG7Qsevlg4A6FRcycDLReu6/LZPuCVK8TiYy/C9PUEqb3dxUIVVefZPho6IpbNnNGu128cVw8gaC60kzaxlFht8RZhac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UgNyk9YC; 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="UgNyk9YC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4961EC2BCB8; Mon, 4 May 2026 14:20:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777904429; bh=Qw1xDlb6MAPFvHZvXe3bn/LTwdKZw3KvuvqWUEvC9CY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UgNyk9YCFRWoAgs5ndzUl8np0Du9t7XLxtcH53aeJOz8y5KjWR4SCP5RaMQMywmjm 9+gjFo0Z5xn9EMShhHD6MwDWhQ7sZa6gsWSvTS6+fXaSA00Tt1eTJsp2SDmBYqhxMK L7ULIGXoL5uTImWA1aU9mjxkWLM/4ppcnVubkL+I= 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 6.12 028/215] zram: do not forget to endio for partial discard requests Date: Mon, 4 May 2026 15:50:47 +0200 Message-ID: <20260504135131.204615573@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260504135130.169210693@linuxfoundation.org> References: <20260504135130.169210693@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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 @@ -2017,7 +2017,7 @@ static void zram_bio_discard(struct zram */ if (offset) { if (n <= (PAGE_SIZE - offset)) - return; + goto end_bio; n -= (PAGE_SIZE - offset); index++; @@ -2032,6 +2032,7 @@ static void zram_bio_discard(struct zram n -= PAGE_SIZE; } +end_bio: bio_endio(bio); }