From: Pavel Begunkov <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [PATCH v3 1/1] io_uring: check for iowq alloc_workqueue failure
Date: Fri, 31 Jan 2025 17:28:21 +0000 [thread overview]
Message-ID: <3a046063902f888f66151f89fa42f84063b9727b.1738343083.git.asml.silence@gmail.com> (raw)
alloc_workqueue() can fail even during init in io_uring_init(), check
the result and panic if anything went wrong.
Fixes: 73eaa2b583493 ("io_uring: use private workqueue for exit work")
Signed-off-by: Pavel Begunkov <[email protected]>
---
v3: BUG_ON() since it seems nobody checks errors
v2: drop kmem_cache checking
io_uring/io_uring.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 263e504be4a8b..dfebd949b8f37 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -3920,6 +3920,7 @@ static int __init io_uring_init(void)
SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT);
iou_wq = alloc_workqueue("iou_exit", WQ_UNBOUND, 64);
+ BUG_ON(!iou_wq);
#ifdef CONFIG_SYSCTL
register_sysctl_init("kernel", kernel_io_uring_disabled_table);
--
2.47.1
next reply other threads:[~2025-01-31 17:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-31 17:28 Pavel Begunkov [this message]
2025-01-31 23:56 ` [PATCH v3 1/1] io_uring: check for iowq alloc_workqueue failure Jens Axboe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3a046063902f888f66151f89fa42f84063b9727b.1738343083.git.asml.silence@gmail.com \
[email protected] \
[email protected] \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox