Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2928023rwb; Mon, 15 Aug 2022 14:13:32 -0700 (PDT) X-Google-Smtp-Source: AA6agR7JaUL6wOjobqKHxT6SLHM/Zwgu1lHRyg2m3GUgaFgO+PyusCeyPSmkRd8o/oxKcW1O6azv X-Received: by 2002:a17:907:608f:b0:734:b422:42f4 with SMTP id ht15-20020a170907608f00b00734b42242f4mr10930516ejc.491.1660598012486; Mon, 15 Aug 2022 14:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598012; cv=none; d=google.com; s=arc-20160816; b=v6NMStPg3AvnmLMgKAh/+aG7sCNYbQa5qe5jEGg1M3X/ezRZUsQjtkPbech/tG2FO8 vyj7/hb2xskvOFGh5zl5qLlAK+3vNeHB2D1+YqoSwLM1ZDojiwNjTaAO4w5o8oe6ie2S J5CxTRgM4XoLFD6QZklVL03LZDALyJ6W5XQIZhVWv8+bdCQ41NNzee9gCb8+lMoKlJrQ E6a2iSWHLCe+RWkx0GxSHrr1jjx3z9gqxOjvIQGHhkjrBRRVVEh3468aTzSxKGshLwjc EEGoUnrB1Mpyvm0vxg/smcEvK9s/kHCUE5yGaF3ShI9swX7w4nYFiTe3YokqcgUycFjh M4cA== 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=NTE0eezXGYLJi0tSqvvJ77BxZabocIjDYekI+Y0r77Y=; b=cRgxx/pEzEUjW52kSo6MpXK5ta3wJSuIZCV659hDx3/JBfAIE7U5sB5nwi/Auxmi+G a6+ZAHvhbBKRO/VEph/nWgF/6nWQYQuQgEfMMFojdb1GioBujLcG0PdpNy5oQHGaXfOz 0pn26l1v+Mpd766RInOWGUHE23DKBM481hUMZeGFWyWG/s6Jon9HM9lpCfXouPWo0w1R ghUhSi+mQ3eVC6vGzRv0KQncq8YjSIEYVbX3mgEb/sitcDfoauq3cMeAXuUJE86FN4xj BzCHVDgV9semF31MuvoSP6l7+fR53hO/QlvN7CgW4AyU+OgZm9vD6HSuGYNF3UWXpcaz IB9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2Md58umy; 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 ne23-20020a1709077b9700b0073153a34a64si10815987ejc.249.2022.08.15.14.13.07; Mon, 15 Aug 2022 14:13: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=2Md58umy; 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 S1345104AbiHOUez (ORCPT + 99 others); Mon, 15 Aug 2022 16:34:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347303AbiHOUbF (ORCPT ); Mon, 15 Aug 2022 16:31:05 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19BC6A4074; Mon, 15 Aug 2022 12:04:40 -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 7AFF0B8110A; Mon, 15 Aug 2022 19:04:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 852F3C433D6; Mon, 15 Aug 2022 19:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660590279; bh=eSCLQPm4JrorGQH+yAQyQacLZ20uAQNUTy1284zWgFg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2Md58umynxB6QaJ6PZPZO/olk7rEyh6KkuTBWoujwiGt9QDHtG8qtpJ70DGpZJyj5 RkIGYZgtKzvSrDgyXkPpcSraOuUAE3G/V0bOQSfbrrx8I/vtYK3QOAE8593FMpJZkx R15exNKP36d2rygbnPyMT8G/J2qpssi0e9xrJQsI= 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.18 0210/1095] block: fix infinite loop for invalid zone append Date: Mon, 15 Aug 2022 19:53:29 +0200 Message-Id: <20220815180438.357692738@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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 d3ca79c3ebdf..fd73ee03d57e 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1199,9 +1199,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