accept operation errors out with "Bad file descriptor" when using IORING_SETUP_SQPOLL
Tested on: Ubuntu 20.04.1 LTS (kernel 5.8.10-050810-generic)
Similar to https://github.com/axboe/liburing/issues/168.
I'm facing the same issue as above but that one was closed without any further discussions.
My setup can be reproduced using the following commands:
git clone https://github.com/fabiormoura/io_uring_sqpoll_example.git
cd io_uring_sqpoll_example
make
sudo ./sqpoll_main
The program should error out with the message cqe->res:Bad file descriptor.
Removing IORING_SETUP_SQPOLL from io_uring_queue_init makes the program run then it can accept one request before exiting if we send one request through curl http://localhost:3000.
SQPOLL only supports registered files, and it doesn't currently work with commands that instantiate file descriptors (like open, accept, etc). This will hopefully change for 5.11, but it will not work for your 5.8 kernel.
Thanks for the explanation. This issue can be closed.