Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1860738rwb; Fri, 19 Aug 2022 10:35:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR55OPbTzRtRuHwl+JNla02uvyvJJHEtDv2mxAHPdaKKcoSH7WKnA3nBp2oWtAkyRIcqh6kg X-Received: by 2002:a17:902:e8d1:b0:172:9bc0:bc9d with SMTP id v17-20020a170902e8d100b001729bc0bc9dmr8327913plg.20.1660930532450; Fri, 19 Aug 2022 10:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660930532; cv=none; d=google.com; s=arc-20160816; b=DO5KiVtx25Kh1Lm8xFuL6UfCLQ9cd77W+U/sm/BuEUIpb3d6gSIv0BNpaq/7bqY/OM yDc1EBvWNKSSA1v9t2vJ73tzxe3BsowdVJq0jk7BSYgXDokKoQbV9e1eNkNEr3uacm/4 3hupWYwN76UxnZ4YamoMoufs/PPkzVxo6vryv7E6hJrT5nNfbUX80DqzgHnWVsf/1xC9 +6qrc3I9LMX6E4/6Ln6vbtvriRVTWEPgbE06fcTHYwgbu6g8MklKwzkuJ6X1fjmSSjRc ybOEVUGEb6Acursdn3w4Ne2ApwaIlRF4y9Ez+WDizlwt3uJZXS5xggMyXkhmubm8RdBU sXVQ== 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=X6F+tMIHlOrgSRPaa0yJiSOIaRVBthHMbtSuzH1pCJI=; b=tY3pqwhbOaGLGZmoeBZlbDSGI6QSpyjsjb79UaOBQS07r32pAObpK6dlHVcZu5Bot5 A7mP4fAnGJ3S0kjnaUByoeMKeHX3KPZLqZlX7sW4UderRzPRNUF2h3+5I5fvnfoNyf0e aT5rK7TpAYO0yMZh/jle21uUqAeeeo1hU2qBGVNqV5kxLHW6d8aAa66WFCQ9c6lAAWjm eB61q438RQNh1DZDZxKkHYsClzoyRj8FYEi/fV4nd1mL8Ht/yRS93cAHqUqgr2rZGa1u ioFaqlfWcufn4u+2e+KDoX6SsGNkyhPaQVmzSJI5x+4HwCkNcyokzsnj/hXTfQCn9Q71 ge7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rCbwQ7s4; 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 e17-20020a170902d39100b0016e3d42897fsi801845pld.277.2022.08.19.10.35.21; Fri, 19 Aug 2022 10:35:32 -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=rCbwQ7s4; 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 S1350917AbiHSP7w (ORCPT + 99 others); Fri, 19 Aug 2022 11:59:52 -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-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 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 = 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