Skip to content

After io_uring_submit() error return, what is the state of the SQEs that were being submitted? #781

Answered by axboe
bateyejoe asked this question in Q&A
Discussion options

You must be logged in to vote

io_uring_enter(2) will return either an error or a number of submitted requests. If you get an error, none were submitted and the SQ ring is in the same state as it was before you made that call. On older kernels, you can get a return value that is positive but less than what you asked for. In that case, the return value is the number of SQEs that were consumed, with the rest being untouched. For newer kernels, you can set IORING_SETUP_SUBMIT_ALL in which case io_uring_enter(2) will always empty the ring, just posting CQEs for errors.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by bateyejoe
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants