diff options
Diffstat (limited to 'io_uring/zcrx.c')
| -rw-r--r-- | io_uring/zcrx.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c index 08c103af69bc..2335f140ff19 100644 --- a/io_uring/zcrx.c +++ b/io_uring/zcrx.c @@ -482,6 +482,7 @@ static struct io_zcrx_ifq *io_zcrx_ifq_alloc(struct io_ring_ctx *ctx) spin_lock_init(&ifq->rq_lock); mutex_init(&ifq->pp_lock); refcount_set(&ifq->refs, 1); + refcount_set(&ifq->user_refs, 1); return ifq; } @@ -742,8 +743,10 @@ void io_unregister_zcrx_ifqs(struct io_ring_ctx *ctx) if (!ifq) break; - io_close_queue(ifq); - io_zcrx_scrub(ifq); + if (refcount_dec_and_test(&ifq->user_refs)) { + io_close_queue(ifq); + io_zcrx_scrub(ifq); + } io_put_zcrx_ifq(ifq); } |