liburing
liburing copied to clipboard
Multishot recv cancel get different completion result depending on the kernel
While building a test case for Zig io_uring implementation I noticed that I'm getting different results depending on the Linux kernel.
In the test there is active multishot recv operation. When I cancel that operation I got two completions, one for cancel operation cqe_cancel and another for multishot recv operation cqe_recv. According to documentation I expected that cqe_cancel has res = 0 (success) and cqe_recv has res = -124 (canceled). And that is what I get on kernel 6.5.
On older kernels 6.0, 6.1, 6.2, 6.4 I got for cqe_cancel res = -2 (noent) and cqe_recv res = -105 (nobufs).
I'm now handling both cases as successful cancel operation.
I understand that this is not liburing's behavior, and not an issue of liburing. But still can be something which can surprise some users.
Interesting, don't immediately recall any changes there that would explain it between eg 6.4 and 6.5. The 6.5 behavior sounds correct, the older one definitely not. I'll take a look.
Are you using stable kernels or the Linus releases?
I test it on Ubuntu:
Linux thinkpad 6.5.7-060507-generic #202310102154 SMP PREEMPT_DYNAMIC Tue Oct 10 22:00:30 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
by installing different kernels using ubuntu-mainline-kernel.sh And then running on the kernels: v6.0.17-060017 v6.1.57-060157 v6.2.12-060212 v6.3.13-060313 v6.4.16-060416 and the default one v6.5.7-060507.
Hope that helps.