Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3022616rwb; Mon, 15 Aug 2022 16:20:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR5U4p9Yes4iuZ6kYG0j39PCd3GXk1vRGUPCq4qPyQzxOhukQB1ZWiYtwcR1HUpVaAg8s9UO X-Received: by 2002:a65:4388:0:b0:41b:c071:d21f with SMTP id m8-20020a654388000000b0041bc071d21fmr15405251pgp.335.1660605605844; Mon, 15 Aug 2022 16:20:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605605; cv=none; d=google.com; s=arc-20160816; b=GQ0LFSSqLvEgag1/BK/VamaNJzI5/NnEb8viBFIIOeY9B1a43IqkuY86P2jm6mS45V OUnQjQScewFFRLs4sWbz5SAoyKOIDW//RxGDSep1o++qppfLJ31UP01gBp25Thx91Jy1 GKzeUrXz2Aqw5rzKAdTIjlXn8jAngznG5nzsaYwClhdJqRaG3FIDF3i+P6wjFLD1HJPk oPCylp9Xt6hGkWqgJJCupvReHptkHFO/b/UWpNuR7hX1P8z/L+8tXWnkblZR6bpghwWJ PxaH1CFYDZX9CGN6iF/ZFx8u5b3IZ6623uV3+xsIf33lYlIiCXIc8Tyg+GtT8XDr352v 8pAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H1YzXutRaw9vNWC+0fQQlgxNJltzZD4WiESwL9yfdoY=; b=LsWeqrWS3GBCTWMAhAftEz6sgz+rQmX2yhO3pJ0a4qzEID8MLtrfHEsJ/8cxWtJFq4 QVoRPTcX89DMKvUgMEppIxYALuhuk32I4DCsu9Ur0xxlcBjI0MAWeIZqs0wbbPdYX/aN QK6kLixmRyxfJQ0iWRnuCRSNlgwuClAcYMoZUWTuP21TzwwjnMMvZ3v30zWlge0tYY7X keE3gUk84g75Um17+om7xmxZM6Mv6I+x2zWDDiSfafJwzbp5wmqwUOzcPsQBcjkRDnmc a2GI5UXAwRXcZionMGpOFj+NhtC8QgQ89ZMxpwN/bzipiyrB+ImvIWfZxjxOhQvYjhDv S78w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XEMdlSdV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 200-20020a6301d1000000b00425f2cdd0dcsi7827434pgb.103.2022.08.15.16.19.54; Mon, 15 Aug 2022 16:20:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=XEMdlSdV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351584AbiHOWs5 (ORCPT + 99 others); Mon, 15 Aug 2022 18:48:57 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = 0; - 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 -- 2.35.1