Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp639724pxv; Thu, 15 Jul 2021 12:11:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx1GdhE5wtxBE8411InhlgqsUviAq7rE9s3Rb7UHK/nDcFUY/eV/xdWR2oA4gVu1MRwS/e X-Received: by 2002:a05:6e02:1e02:: with SMTP id g2mr3795143ila.6.1626376293991; Thu, 15 Jul 2021 12:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376293; cv=none; d=google.com; s=arc-20160816; b=CuwuHb/5QjDgXaG3UnsDcPlDfkVkJgn8Flg+/xnnRYpVs8MiNWGhkmm+7ukNJSRqVx bVeW8mfG1ryn5fNNSIPnYVSpX3n9DzC+BekHmbeubrUtVPpgXOV2KupCaq3NWpxBCQmK 0Tc0vicPm1Ul5SX6y7ZyHKcx1E+6a7yieh8B58QHd44lWk91v6V8xgdl3q0Wcgk3aPnf jsL58nT3cRm4vhHxvj37+JpvkK5UOQHtbVJwpjpm7a3adcL2Pa0I1BuZ5o/bcgnEv+6a oBLhjGmjRZH9UyTaHFHh+/JqdZTOMlD/fAwOTf0bg9l++JE9AhOvOonEtvuvc5TcNGoO YYNA== 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=qrDRtsHRzYrmQTeDHk8jg3tp3m1Wst8eclGxLNjl99c=; b=wIUWp4A/AbTLRMMxIhfC1MkxUvCI3oXU3NnPzywLgnJGdKrldaWdY70RonpXzpzgAV JCcPVRJ7yrEDyWOPfo2EH0q7+p4K1l+xuBHIX6qrURGZDAjU0eblsb35koD4fmVO6IK1 8K4B0FIz/C/+IYJ4hiEZDxZMbHYsFkBcesWe8CUrWvPkYAN0JdGSI3Rn7dvlWvf/32WE Ce0uaK1ClGcO/DkFZ2AxiUThBeBX5c/5maY2RzyopGNaxqx0G+8BuQ9M9/yd/LIwTEDW wZidaY32QLHMiRUv321LiHMDtXcaQmLdXiD7DZbBL1equRZ84tV1/Fm3ReM5H+AS7prs r5xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=awDBdnZf; 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 d21si7195828jam.9.2021.07.15.12.11.20; Thu, 15 Jul 2021 12:11:33 -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=awDBdnZf; 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 S242368AbhGOTNL (ORCPT + 99 others); Thu, 15 Jul 2021 15:13:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:38864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241938AbhGOTBN (ORCPT ); Thu, 15 Jul 2021 15:01:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AE657613DC; Thu, 15 Jul 2021 18:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375473; bh=TRgNq0RCv+xZeGNXwvsLOUrnCmvhW5krvQzCnNyScIA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=awDBdnZftaudcAXsM7jw/uUFHKJyarLvCuhJ43248UE0pkGCo3KTdbRR/cn0kVbdM cjNnlQ2NU2bFWnBkVydpt2J4zp7V1MUwv/P7+xLRPlJ2nCgoWsvOy8XNk4ud4X+Ngb MNHpmaiuNK4GePnNO2MhprHYmGPYzFCeqGUqXLcs= 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.12 101/242] io_uring: fix false WARN_ONCE Date: Thu, 15 Jul 2021 20:37:43 +0200 Message-Id: <20210715182610.814803765@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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 4eba531bea5a..b836737f96f3 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -243,7 +243,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); @@ -991,6 +992,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