Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp655220pxv; Thu, 15 Jul 2021 12:36:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx1wwTOrQCgbNJqG8qYTc7ENalENojKJT7y7lGLjd8qsJcWzPsyVWJljvU1coTUFdSSvs/ X-Received: by 2002:a17:906:53d1:: with SMTP id p17mr7414203ejo.208.1626377795912; Thu, 15 Jul 2021 12:36:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377795; cv=none; d=google.com; s=arc-20160816; b=d9LyzCp2KaQdUIwUvTjOONCQ67/j3e4qMoN+bDuWmmhTCvSQvI3rD60QZjITHq8QvT I82PZ9dXcOZswHMwxKbQtQZKazG8xLhvjRsoG/lnRjjf+FoDqLCMRc0ODD0TIzor66Rh dMtv3gVLVIyFnBWsmFAIQMGXqKDg+ZcjTFnyjm7Y6JqJj3Kw1ykoF+6jpGuPCwANP7Dw UdXENBncbhnl3uvtO42eF6RUa6pSL/Uq37c5otM5TXnmGP2BhProHiuI6QbrQfN3b4q3 iW4Qc3OKSSAzLbuiKo6NWV16gH6aZJ3rPnY+WBR+CcjEAAwqOGlMxZ2KqT29sMQoIpmM FEYA== 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=7s+2UeYmblUfTu9zHt733PCZcHcI3lyQtd8GQ7Hbi5U=; b=KMYvIQavqIZiNYlr49juzALDliWPgBemDBxPqopw5Ggrz3YBccEaB8UWl2fV8De565 /4//u6m+j5vdPfsv/QMnxzE7Vwije09WLzobKFRN4K4RyjP9QBfgQyt2FepWp3oGwAcC HP+0xOJze7x7NVhm++KNTCIaE2Wxr61kMJB4tPnvwRhe3XXqUubSKlY0w6uzLc7+yVyV 0pVI0K8xSteGl2FLqTTNPmwx/pJMaGXHRElCtHsa/oJJAIVOYhx5i4jIyz/9O3xbmnkZ /VFWciqv3vcttjZ/qvDtn/BizqbNuKuvhkADENUTPAWe1AN1R1+oSSEQCeLe2wBWaEub rFBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DVw+Dv8Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 6si9171157eje.471.2021.07.15.12.36.12; Thu, 15 Jul 2021 12:36:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DVw+Dv8Z; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1345420AbhGOTgS (ORCPT + 99 others); Thu, 15 Jul 2021 15:36:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:50846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244030AbhGOTMg (ORCPT ); Thu, 15 Jul 2021 15:12:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E03AB613D8; Thu, 15 Jul 2021 19:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376143; bh=QUvN+qREW2qmUAiRphV02G9Yj2oxJVfc6d6/h1ouvag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DVw+Dv8ZDPiM18q5Z6a5BsxOc6oeKK4KByRFvmqZ/QZTvTEUOFb+3BxU0x3o/vwDD OGP32DuiXhD+r9G1HI5FkL0L+u1NdLeFghVvV8mHOrbj+6O1ODx9W4FBGBN9i2quOc P5nh4h0pfKqDRwxYyAKdCB1a/BYM6EXC0J3IWij4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+ea2f1484cffe5109dc10@syzkaller.appspotmail.com, Pavel Begunkov , Jens Axboe , Sasha Levin Subject: [PATCH 5.13 118/266] io_uring: fix false WARN_ONCE Date: Thu, 15 Jul 2021 20:37:53 +0200 Message-Id: <20210715182634.720346718@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Begunkov [ Upstream commit e6ab8991c5d0b0deae0961dc22c0edd1dee328f5 ] WARNING: CPU: 1 PID: 11749 at fs/io-wq.c:244 io_wqe_wake_worker fs/io-wq.c:244 [inline] WARNING: CPU: 1 PID: 11749 at fs/io-wq.c:244 io_wqe_enqueue+0x7f6/0x910 fs/io-wq.c:751 A WARN_ON_ONCE() in io_wqe_wake_worker() can be triggered by a valid userspace setup. Replace it with pr_warn. Reported-by: syzbot+ea2f1484cffe5109dc10@syzkaller.appspotmail.com Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/f7ede342c3342c4c26668f5168e2993e38bbd99c.1623949695.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- fs/io-wq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/io-wq.c b/fs/io-wq.c index b3e8624a37d0..60f58efdb5f4 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -241,7 +241,8 @@ static void io_wqe_wake_worker(struct io_wqe *wqe, struct io_wqe_acct *acct) * Most likely an attempt to queue unbounded work on an io_wq that * wasn't setup with any unbounded workers. */ - WARN_ON_ONCE(!acct->max_workers); + if (unlikely(!acct->max_workers)) + pr_warn_once("io-wq is not configured for unbound workers"); rcu_read_lock(); ret = io_wqe_activate_free_worker(wqe); @@ -906,6 +907,8 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data) if (WARN_ON_ONCE(!data->free_work || !data->do_work)) return ERR_PTR(-EINVAL); + if (WARN_ON_ONCE(!bounded)) + return ERR_PTR(-EINVAL); wq = kzalloc(sizeof(*wq), GFP_KERNEL); if (!wq) -- 2.30.2