Skip to content

Commit f64f76b

Browse files
committed
ioq: Copy ring_ops from the previous thread
Otherwise threads 2-N won't use io_uring at all! Oops. Fixes: 8bc72d6 ("ioq: Probe for supported io_uring operations")
1 parent 61adc84 commit f64f76b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/ioq.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,7 @@ static int ioq_ring_init(struct ioq *ioq, struct ioq_thread *thread) {
850850

851851
if (prev) {
852852
// Initial setup already complete
853+
thread->ring_ops = prev->ring_ops;
853854
return 0;
854855
}
855856

@@ -916,12 +917,14 @@ static void ioq_thread_join(struct ioq_thread *thread) {
916917
}
917918

918919
struct ioq *ioq_create(size_t depth, size_t nthreads) {
919-
struct ioq *ioq = ZALLOC_FLEX(struct ioq, threads, nthreads);
920+
struct ioq *ioq = ALLOC_FLEX(struct ioq, threads, nthreads);
920921
if (!ioq) {
921922
goto fail;
922923
}
923924

924925
ioq->depth = depth;
926+
ioq->size = 0;
927+
ioq->cancel = false;
925928

926929
ARENA_INIT(&ioq->ents, struct ioq_ent);
927930

0 commit comments

Comments
 (0)