Skip to content

Commit f3fa7f0

Browse files
committed
Merge tag 'io_uring-6.3-2023-03-30' of git://git.kernel.dk/linux
Pull io_uring fixes from Jens Axboe: - Fix a regression with the poll retry, introduced in this merge window (me) - Fix a regression with the alloc cache not decrementing the member count on removal. Also a regression from this merge window (Pavel) - Fix race around rsrc node grabbing (Pavel) * tag 'io_uring-6.3-2023-03-30' of git://git.kernel.dk/linux: io_uring: fix poll/netmsg alloc caches io_uring/rsrc: fix rogue rsrc node grabbing io_uring/poll: clear single/double poll flags on poll arming
2 parents 2bac7dc + fd30d1c commit f3fa7f0

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

io_uring/alloc_cache.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ static inline struct io_cache_entry *io_alloc_cache_get(struct io_alloc_cache *c
2727
struct hlist_node *node = cache->list.first;
2828

2929
hlist_del(node);
30+
cache->nr_cached--;
3031
return container_of(node, struct io_cache_entry, node);
3132
}
3233

io_uring/poll.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@ int io_arm_poll_handler(struct io_kiocb *req, unsigned issue_flags)
726726
apoll = io_req_alloc_apoll(req, issue_flags);
727727
if (!apoll)
728728
return IO_APOLL_ABORTED;
729+
req->flags &= ~(REQ_F_SINGLE_POLL | REQ_F_DOUBLE_POLL);
729730
req->flags |= REQ_F_POLLED;
730731
ipt.pt._qproc = io_async_queue_proc;
731732

io_uring/rsrc.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,13 @@ static inline void io_req_set_rsrc_node(struct io_kiocb *req,
144144
unsigned int issue_flags)
145145
{
146146
if (!req->rsrc_node) {
147-
req->rsrc_node = ctx->rsrc_node;
147+
io_ring_submit_lock(ctx, issue_flags);
148148

149-
if (!(issue_flags & IO_URING_F_UNLOCKED)) {
150-
lockdep_assert_held(&ctx->uring_lock);
149+
lockdep_assert_held(&ctx->uring_lock);
151150

152-
io_charge_rsrc_node(ctx);
153-
} else {
154-
percpu_ref_get(&req->rsrc_node->refs);
155-
}
151+
req->rsrc_node = ctx->rsrc_node;
152+
io_charge_rsrc_node(ctx);
153+
io_ring_submit_unlock(ctx, issue_flags);
156154
}
157155
}
158156

0 commit comments

Comments
 (0)