io_uring: fix copy_cqes logic

This commit is contained in:
Igor Anić 2024-03-31 23:52:46 +02:00
parent 631c28c9e3
commit 704660c81a

View File

@ -284,7 +284,7 @@ fn copy_cqes_ready(self: *IoUring, cqes: []linux.io_uring_cqe) u32 {
const head = self.cq.head.* & self.cq.mask;
const tail = (self.cq.head.* +% count) & self.cq.mask;
if (head <= tail) {
if (head < tail) {
// head behind tail -> no wrapping
@memcpy(cqes[0..count], self.cq.cqes[head..tail]);
} else {