fix(driver,unix): add some control API usages#832
Merged
Berrysoft merged 4 commits intocompio-rs:masterfrom Apr 6, 2026
Merged
fix(driver,unix): add some control API usages#832Berrysoft merged 4 commits intocompio-rs:masterfrom
Berrysoft merged 4 commits intocompio-rs:masterfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Unix socket send/recv ops in the polling and io-uring backends to use the shared *MsgControl control structures (holding msghdr + iovecs) so self-referential msghdr state lives in OpCode::Control rather than on the op itself.
Changes:
- Refactors poll-based
recvmsg/sendmsgvectored ops to build and useSendMsgControlduringinit, and capturesmsg_nameleninto the op result state. - Refactors io-uring
RecvFrom*/SendTo*ops to createRecvMsgControl/SendMsgControlcontrols up-front and plumb them intocreate_entry, withname_lentracked on completion. - Refactors io-uring managed
RecvFromManagedto movemsghdr/iovecinto a dedicated control type.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| compio-driver/src/sys/poll/op.rs | Switches poll-based vectored send/recv-from ops to use SendMsgControl control state. |
| compio-driver/src/sys/iour/op/mod.rs | Switches io-uring send-to/recv-from ops to build *MsgControl in init and use it in create_entry. |
| compio-driver/src/sys/iour/op/managed.rs | Moves RecvFromManaged’s msghdr/iovec into Control to support control API usage with buffer selection. |
Comments suppressed due to low confidence (1)
compio-driver/src/sys/iour/op/managed.rs:233
RecvFromManaged::newno longer validates the requestedlen(previously rejected values that don’t fit expected limits). Other managed ops in this module still returnInvalidInputwhenlenis too large (e.g.RecvManaged). Consider restoring a bounds check (at least rejecting values that don’t fit the underlying io-uring / buffer-pool constraints) to keep API behavior consistent and avoid kernel EINVALs for oversized iov lengths.
impl<S> RecvFromManaged<S> {
/// Create [`RecvFromManaged`].
pub fn new(fd: S, buffer_pool: &BufferPool, len: usize, flags: i32) -> io::Result<Self> {
let addr = SockAddrStorage::zeroed();
Ok(Self {
fd,
buffer_group: buffer_pool.buffer_group()?,
flags,
name_len: 0,
buffer_len: len,
addr,
buffer_pool: buffer_pool.clone(),
buffer: None,
})
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3 tasks
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
I don't know why they were forgotten last time.