Repository navigation
[GIT PULL] queue: check EXT_ARG support before flushing registered waits - #1628
Merged
Merged
Conversation
io_uring_submit_and_wait_reg() initializes get_data before checking IORING_FEAT_EXT_ARG. The initializer calls __io_uring_flush_sq(), so an unsupported call returns -EINVAL after advancing the private SQ head and publishing the SQ tail. That can strand pending entries on a normal ring. If an SQPOLL thread is active, it can execute them even though the helper returned an error. Check the feature first, as io_uring_submit_and_wait_min_timeout() already does. Add a regression test which verifies that the unsupported path leaves both the private SQ head and published SQ tail unchanged. Fixes: a436470 ("Add support for registered waits") Signed-off-by: David Sarkisyan <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This moves the existing feature check ahead of
__io_uring_flush_sq().I reproduced the current behavior with an active SQPOLL ring: the helper returned
-EINVAL, but a tagged NOP still completed because the SQ tail had already been published. With this change, the same call returns-EINVALwithout publishing the pending SQE.Tests:
reg-wait.twith GCCreg-wait.twith Clang ASan/UBSanreg-wait.t,submit-and-wait.t,sqpoll-sleep.t,sqpoll-exec.t,sq-poll-kthread.t, andsq-poll-share.tThe full GCC suite also ran.
reg-wait.tpassed. Four unrelated failures reproduced on unpatched current upstream, and a fifth transient test passed on three immediate retries and on the upstream control.