From nobody Mon Sep 29 21:26:49 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 9AFE5C00140 for ; Mon, 15 Aug 2022 22:49:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351589AbiHOWs7 (ORCPT ); Mon, 15 Aug 2022 18:48:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351868AbiHOWrQ (ORCPT ); Mon, 15 Aug 2022 18:47:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FD2A134BA0; Mon, 15 Aug 2022 12:52:58 -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 62227B81142; Mon, 15 Aug 2022 19:52:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2096C433C1; Mon, 15 Aug 2022 19:52:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593175; bh=NfEflS+XGbbTxMU1Q5X9tKOLlBZmZJ2ffzxDGM/bjCE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XEMdlSdVorJdjhW4g5wvwtnvnYGB5gj70i54su/YXEKH7i0ociPNNK6jOfzhGbldP AEWaJThruiB+VkN1UfYSx7qRv4ZtfF4Wgv1No3wWqq4zcm4vKyed0gHqoSCH/oQxCO Lgh9MCxFsqOG3WLOsJigK/v2fuGAUyIA79uBh8AE= 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.19 0225/1157] block: fix infinite loop for invalid zone append Date: Mon, 15 Aug 2022 19:53:01 +0200 Message-Id: <20220815180448.589187534@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 51c99f2c5c90..d9ff51fc457e 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1229,9 +1229,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