IOCompletions: abort other remaining completions if previous one errors

This commit is contained in:
pedrocarlo
2025-08-21 23:02:57 -03:00
parent bd8cfe40f1
commit be855a8059

View File

@@ -2480,8 +2480,15 @@ impl IOCompletions {
match self {
IOCompletions::Single(c) => io.wait_for_completion(c),
IOCompletions::Many(completions) => {
for c in completions {
io.wait_for_completion(c)?;
let mut completions = completions.into_iter();
while let Some(c) = completions.next() {
let res = io.wait_for_completion(c);
if res.is_err() {
for c in completions {
c.abort();
}
return res;
}
}
Ok(())
}