Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2808296rwb; Mon, 15 Aug 2022 11:45:47 -0700 (PDT) X-Google-Smtp-Source: AA6agR6yK1k7OxNXCK/ZRkaKYWe43i75CGqIdEgsv/MkLICfRr7fE72uRVO4G/QcKLlJt1RCVpWg X-Received: by 2002:a17:906:8445:b0:730:ba5a:ef59 with SMTP id e5-20020a170906844500b00730ba5aef59mr11647184ejy.182.1660589147244; Mon, 15 Aug 2022 11:45:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660589147; cv=none; d=google.com; s=arc-20160816; b=ABQJhQsRjuiVrUqDJ7nJ2OFi8pvcVjKnBbETCOyZWOMKS4YCRn2bYDkgCFfZOH0KcX uA0x6GJmzyLF4Vc2aACOrx8CCa/2fCzWQSvXWkCCxV4gJr4DXszWgzqBSBQ5waHf9pgq h0YQ2+wlVXscyZOSIjJcgEOEsobflRJ41tHRE9CphgDy6VnYGM5HwzA/drJOPZ4zTwNm EjVN3Py8eFmI5oYGyWmDToGkJz4sgdWVlRMVnFAoIjYsoXwzCnG2usitX/l0+g3neW5x t/hURtqqXyDHsyfu9UP1MLBJhcg4Xrw6GWAuOSFZ2kXnZH5CihTnraJiWDFqCV2i4+cm 1AbQ== 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=g0uJq5WPN0lv4qHSX5KtH7BDv756JzagqOlyjSvnCzg=; b=eFI57bvIXO5mHsh0syhaF7TJpGTkuyYydfIQcF48g1fbOcj29BqnRI1mtNbZerpsjr 7f+uoXilHjBZEeO8iyfQLCxxTQZ7DfZfliE7pyE8OW+/pP6p4Sik/1nxEOauZ7lE22eM ZPjOhkbu6ahy9QLzVDOfsTFysRBoM8af3xt2wUZav1HTYwUjrQfRuOV8bVSJaN4lRlG3 1I6/RBNzndYf5QKUbgLTMSf9ENyqRHluaK+jjXualkKdBOc+VMBYYSsWcEVFxWjY/bld lObz8iKI487XuPXJVWc1e/J1Zg9g8zIwieoPqZ2byEIyPeRqF61L7jEtojr2WIRErP+i pJNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=0S9NbEnf; 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 nb21-20020a1709071c9500b0073114ebf70esi7873275ejc.261.2022.08.15.11.45.21; Mon, 15 Aug 2022 11:45:47 -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=0S9NbEnf; 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 S243293AbiHOSfY (ORCPT + 99 others); Mon, 15 Aug 2022 14:35:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50608 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243404AbiHOSek (ORCPT ); Mon, 15 Aug 2022 14:34:40 -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 3251539BAA; Mon, 15 Aug 2022 11:22:20 -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 AB697B81074; Mon, 15 Aug 2022 18:22:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AF5DC433D6; Mon, 15 Aug 2022 18:22:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587736; bh=I0s1FfCSKS4Q7n/lumfgFGstKL5ewoslGKP/jBS5Qv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0S9NbEnfYepc6g2a/LwxPQdY8GXKp+nLO7EHYi2YAzrlkT/6t+3M+OV4xAiDNXDHd aTjGtNgJpZrq6nob2vmHaFw2jwwOMXWLSA4pCvL75Tw8J+AtgsdqJU1wDxCbrmgVPP wZmqBu01YzJ35b8zBt9x/d/1ZR+xjyIFz8YfSE/8= 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.15 178/779] block: fix infinite loop for invalid zone append Date: Mon, 15 Aug 2022 19:57:02 +0200 Message-Id: <20220815180344.875920711@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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 b8a8bfba714f..b117765d58c0 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1141,9 +1141,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