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 EDE4734CFC3; Fri, 15 May 2026 15:59:00 +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=1778860741; cv=none; b=ARtWd/D5tg5IbvElpi6Y/XYV9z2kQmQbyAwW0Ka44kucCBfnYayAKgi81sXjZ5v/qrb8hQHN9ZL1lkXFMyXTHLzZyzJAdarJOb9VjyzSVjSDd/f5V5xxDGoBwC2HZRvWugF0hz7bqFMHkTn53616DZcA1qG5W7EwH97iSlnfRbM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778860741; c=relaxed/simple; bh=mRJqLUHEnamKMgMxk1oUSWd0UZyHGNLUXKf4iw8mmKY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mxnHoLW5L4NJ0W2iLLgqSWJ0ExvYgPjjCK5RzWMAEUnvgrHO3X2G+U+F0Q+9RWtF0WnYXIL3o0khUh8zVISaing404NJedkirpFcI2qYfabVHRKEao0u4+Z1nA7guFvPOqpfqjbzXr+SeZiJxvjKAZDfzwFjIicNiQBYiPDLuDU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=cRlxxpYq; 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="cRlxxpYq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 858CFC2BCB0; Fri, 15 May 2026 15:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778860740; bh=mRJqLUHEnamKMgMxk1oUSWd0UZyHGNLUXKf4iw8mmKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cRlxxpYqnvyWo4x7nsa453gTZFOM6xsbP/Kf+3cp/XtkI1LtuA6CutXn+yQrBrJW1 SWQ776zxK+dM4ajiMrQQJCx8sBPz2c3FhgAq02m6td23IMms0GAOLuZ0rXou2bZO6l w1GOMn7Iiu9ntIvFmYhH4k3HBGhLuVzZx8mchzds= 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.6 024/474] zram: do not forget to endio for partial discard requests Date: Fri, 15 May 2026 17:42:13 +0200 Message-ID: <20260515154715.574894788@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260515154715.053014143@linuxfoundation.org> References: <20260515154715.053014143@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.6-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 @@ -1880,7 +1880,7 @@ static void zram_bio_discard(struct zram */ if (offset) { if (n <= (PAGE_SIZE - offset)) - return; + goto end_bio; n -= (PAGE_SIZE - offset); index++; @@ -1895,6 +1895,7 @@ static void zram_bio_discard(struct zram n -= PAGE_SIZE; } +end_bio: bio_endio(bio); }