From nobody Tue Dec 16 16:37:05 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 564C8C32771 for ; Fri, 19 Aug 2022 15:59:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350708AbiHSP7x (ORCPT ); Fri, 19 Aug 2022 11:59:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350825AbiHSP5s (ORCPT ); Fri, 19 Aug 2022 11:57:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50C89108F22; Fri, 19 Aug 2022 08:51:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 01EFAB82818; Fri, 19 Aug 2022 15:51:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6075DC433D6; Fri, 19 Aug 2022 15:51:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924301; bh=w5eZTdyW0/Q0cvE8Zzj/7xqO49ceUXfYFU3tvte4MTg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rCbwQ7s4jz6OWL1c1H+zTglvXy7Q5lkRzSDVWXQqK01PcKzVkQDzFx70DVI0tqW2h r5WQnZ0M8knc4y5JY4xrbF16kbsq/d0yrYOZZaiCQE0lVTEtB4XsaBRepYSZwzJ/a2 5G5a2OR0ezSvSGJdqcZOYXx9FH/ZbAqbQCRwjg+0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Keith Busch , Damien Le Moal , Christoph Hellwig , Johannes Thumshirn , Jens Axboe , Sasha Levin Subject: [PATCH 5.10 125/545] block: fix infinite loop for invalid zone append Date: Fri, 19 Aug 2022 17:38:15 +0200 Message-Id: <20220819153834.898143118@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Keith Busch [ Upstream commit b82d9fa257cb3725c49d94d2aeafc4677c34448a ] Returning 0 early from __bio_iov_append_get_pages() for the max_append_sectors warning just creates an infinite loop since 0 means success, and the bio will never fill from the unadvancing iov_iter. We could turn the return into an error value, but it will already be turned into an error value later on, so just remove the warning. Clearly no one ever hit it anyway. Fixes: 0512a75b98f84 ("block: Introduce REQ_OP_ZONE_APPEND") Signed-off-by: Keith Busch Reviewed-by: Damien Le Moal Reviewed-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Link: https://lore.kernel.org/r/20220610195830.3574005-2-kbusch@fb.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- block/bio.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/bio.c b/block/bio.c index f8d26ce7b61b..6d6e7b96b002 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1057,9 +1057,6 @@ static int __bio_iov_append_get_pages(struct bio *bio= , struct iov_iter *iter) size_t offset; int ret =3D 0; =20 - if (WARN_ON_ONCE(!max_append_sectors)) - return 0; - /* * Move page array up in the allocated memory for the bio vecs as far as * possible so that we can start filling biovecs from the beginning --=20 2.35.1