Skip to content

Commit 77b5ef1

Browse files
committed
fix(driver,poll): don't check cancelled in push
1 parent 368b6b5 commit 77b5ef1

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

compio-driver/src/poll/mod.rs

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -212,28 +212,24 @@ impl Driver {
212212
op: &mut Key<T>,
213213
) -> Poll<io::Result<usize>> {
214214
let user_data = op.user_data();
215-
if self.cancelled.remove(&user_data) {
216-
Poll::Ready(Err(io::Error::from_raw_os_error(libc::ETIMEDOUT)))
217-
} else {
218-
let op_pin = op.as_op_pin();
219-
match op_pin.pre_submit() {
220-
Ok(Decision::Wait(arg)) => {
221-
// SAFETY: fd is from the OpCode.
222-
unsafe {
223-
self.submit(user_data, arg)?;
224-
}
225-
Poll::Pending
215+
let op_pin = op.as_op_pin();
216+
match op_pin.pre_submit() {
217+
Ok(Decision::Wait(arg)) => {
218+
// SAFETY: fd is from the OpCode.
219+
unsafe {
220+
self.submit(user_data, arg)?;
226221
}
227-
Ok(Decision::Completed(res)) => Poll::Ready(Ok(res)),
228-
Ok(Decision::Blocking(event)) => {
229-
if self.push_blocking(user_data, event) {
230-
Poll::Pending
231-
} else {
232-
Poll::Ready(Err(io::Error::from_raw_os_error(libc::EBUSY)))
233-
}
222+
Poll::Pending
223+
}
224+
Ok(Decision::Completed(res)) => Poll::Ready(Ok(res)),
225+
Ok(Decision::Blocking(event)) => {
226+
if self.push_blocking(user_data, event) {
227+
Poll::Pending
228+
} else {
229+
Poll::Ready(Err(io::Error::from_raw_os_error(libc::EBUSY)))
234230
}
235-
Err(err) => Poll::Ready(Err(err)),
236231
}
232+
Err(err) => Poll::Ready(Err(err)),
237233
}
238234
}
239235

0 commit comments

Comments
 (0)