Skip to content

Commit

Permalink
fix(driver,iour): log cancel fail and fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Berrysoft committed Mar 12, 2024
1 parent bcf9301 commit f5284ea
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions compio-driver/src/iour/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pub use std::os::fd::{AsRawFd, FromRawFd, IntoRawFd, RawFd};
use std::{io, os::fd::OwnedFd, pin::Pin, ptr::NonNull, sync::Arc, task::Poll, time::Duration};

use compio_log::{instrument, trace};
use compio_log::{instrument, trace, warn};
use crossbeam_queue::SegQueue;
cfg_if::cfg_if! {
if #[cfg(feature = "io-uring-cqe32")] {
Expand Down Expand Up @@ -96,7 +96,7 @@ impl Driver {
.user_data(Self::NOTIFY)
.into(),
)
.expect("the squeue sould not be empty");
.expect("the squeue sould not be full");
}
Ok(Self {
inner,
Expand All @@ -108,7 +108,7 @@ impl Driver {

// Auto means that it choose to wait or not automatically.
fn submit_auto(&mut self, timeout: Option<Duration>) -> io::Result<()> {
instrument!(compio_log::Level::TRACE, "submit_auto", ?timeout, wait);
instrument!(compio_log::Level::TRACE, "submit_auto", ?timeout);
let res = {
// Last part of submission queue, wait till timeout.
if let Some(duration) = timeout {
Expand Down Expand Up @@ -172,15 +172,19 @@ impl Driver {
trace!("cancel RawOp");
unsafe {
#[allow(clippy::useless_conversion)]
self.inner
if self
.inner
.submission()
.push(
&AsyncCancel::new(user_data as _)
.build()
.user_data(Self::CANCEL)
.into(),
)
.ok();
.is_err()
{
warn!("could not push AsyncCancel entry");
}
}
}

Expand Down

0 comments on commit f5284ea

Please sign in to comment.