io_uring/eventfd: move to more idiomatic RCU free usage
authorJens Axboe <axboe@kernel.dk>
Mon, 3 Jun 2024 17:19:10 +0000 (11:19 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 16 Jun 2024 20:54:55 +0000 (14:54 -0600)
commit60b6c075e8eb8bd23c106e2ab13370a146a94a5b
treec0e9290454a312d572705bbb9f6d242a5ba32605
parentf4eaf8eda89e1ae5d8274297094687245293deff
io_uring/eventfd: move to more idiomatic RCU free usage

In some ways, it just "happens to work" currently with using the ops
field for both the free and signaling bit. But it depends on ordering
of operations in terms of freeing and signaling. Clean it up and use the
usual refs == 0 under RCU read side lock to determine if the ev_fd is
still valid, and use the reference to gate the freeing as well.

Fixes: 21a091b970cd ("io_uring: signal registered eventfd to process deferred task work")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/io_uring.h
io_uring/register.c