VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   35 Branches   59 Tags
author: Pavel Begunkov <asml.silence@gmail.com> 2021-06-17 18:13:59 +0100 committer: Greg Kroah-Hartman <gregkh@linuxfoundation.org> 2021-07-19 10:04:41 +0200 commit: a8eca6968b1e66785ef142db65afa62c26ec1029 parent: 9e134247013e29e0a0c13365f47f1394824a522f
Commit Summary:
io_uring: fix false WARN_ONCE
Diffstat:
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)