Skip to content

Commit 3313a73

Browse files
committed
MDEV-36234: dualstack aio/io_uring - document EPERM error
As noted by Jens Axobe, errno isn't set, it is returned by the io_uring_queue_init function.
1 parent df9e1b6 commit 3313a73

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tpool/aio_liburing.cc

+8-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ class aio_uring final : public tpool::aio
3434
public:
3535
aio_uring(tpool::thread_pool *tpool, int max_aio) : tpool_(tpool)
3636
{
37-
if (io_uring_queue_init(max_aio, &uring_, 0) != 0)
37+
if (const auto e= io_uring_queue_init(max_aio, &uring_, 0))
3838
{
39-
switch (const auto e= errno) {
39+
switch (-e) {
4040
case ENOMEM:
4141
my_printf_error(ER_UNKNOWN_ERROR,
4242
"io_uring_queue_init() failed with ENOMEM:"
@@ -57,6 +57,12 @@ class aio_uring final : public tpool::aio
5757
"(newer than 5.1 required)",
5858
ME_ERROR_LOG | ME_WARNING);
5959
break;
60+
case EPERM:
61+
my_printf_error(ER_UNKNOWN_ERROR,
62+
"io_uring_queue_init() failed with EPERM:"
63+
" sysctl kernel.io_uring_disabled has the value 2, or 1 and the user of the process is not a member of sysctl kernel.io_uring_group. (see man 2 io_uring_setup).",
64+
ME_ERROR_LOG | ME_WARNING);
65+
break;
6066
default:
6167
my_printf_error(ER_UNKNOWN_ERROR,
6268
"io_uring_queue_init() failed with errno %d",

0 commit comments

Comments
 (0)