diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 93db3e4e7b68..41c0b24db0c0 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2382,7 +2382,9 @@ static bool io_get_sqe(struct io_ring_ctx *ctx, const struct io_uring_sqe **sqe) } /* drop invalid entries */ + spin_lock(&ctx->completion_lock); ctx->cq_extra--; + spin_unlock(&ctx->completion_lock); WRITE_ONCE(ctx->rings->sq_dropped, READ_ONCE(ctx->rings->sq_dropped) + 1); return false;