Skip to content

Commit cb3002e

Browse files
committed
Merge tag 'io_uring-6.16-20250710' of git://git.kernel.dk/linux
Pull io_uring fixes from Jens Axboe: - Remove a pointless warning in the zcrx code - Fix for MSG_RING commands, where the allocated io_kiocb needs to be freed under RCU as well - Revert the work-around we had in place for the anon inodes pretending to be regular files. Since that got reworked upstream, the work-around is no longer needed * tag 'io_uring-6.16-20250710' of git://git.kernel.dk/linux: Revert "io_uring: gate REQ_F_ISREG on !S_ANON_INODE as well" io_uring/msg_ring: ensure io_kiocb freeing is deferred for RCU io_uring/zcrx: fix pp destruction warnings
2 parents c7979c3 + 9dff55e commit cb3002e

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

include/linux/io_uring_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,8 @@ struct io_kiocb {
698698
struct hlist_node hash_node;
699699
/* For IOPOLL setup queues, with hybrid polling */
700700
u64 iopoll_start;
701+
/* for private io_kiocb freeing */
702+
struct rcu_head rcu_head;
701703
};
702704
/* internal polling, see IORING_FEAT_FAST_POLL */
703705
struct async_poll *apoll;

io_uring/io_uring.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,12 +1666,11 @@ static void io_iopoll_req_issued(struct io_kiocb *req, unsigned int issue_flags)
16661666

16671667
io_req_flags_t io_file_get_flags(struct file *file)
16681668
{
1669-
struct inode *inode = file_inode(file);
16701669
io_req_flags_t res = 0;
16711670

16721671
BUILD_BUG_ON(REQ_F_ISREG_BIT != REQ_F_SUPPORT_NOWAIT_BIT + 1);
16731672

1674-
if (S_ISREG(inode->i_mode) && !(inode->i_flags & S_ANON_INODE))
1673+
if (S_ISREG(file_inode(file)->i_mode))
16751674
res |= REQ_F_ISREG;
16761675
if ((file->f_flags & O_NONBLOCK) || (file->f_mode & FMODE_NOWAIT))
16771676
res |= REQ_F_SUPPORT_NOWAIT;

io_uring/msg_ring.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ static void io_msg_tw_complete(struct io_kiocb *req, io_tw_token_t tw)
8282
spin_unlock(&ctx->msg_lock);
8383
}
8484
if (req)
85-
kmem_cache_free(req_cachep, req);
85+
kfree_rcu(req, rcu_head);
8686
percpu_ref_put(&ctx->refs);
8787
}
8888

8989
static int io_msg_remote_post(struct io_ring_ctx *ctx, struct io_kiocb *req,
9090
int res, u32 cflags, u64 user_data)
9191
{
9292
if (!READ_ONCE(ctx->submitter_task)) {
93-
kmem_cache_free(req_cachep, req);
93+
kfree_rcu(req, rcu_head);
9494
return -EOWNERDEAD;
9595
}
9696
req->opcode = IORING_OP_NOP;

io_uring/zcrx.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,10 +863,7 @@ static int io_pp_zc_init(struct page_pool *pp)
863863
static void io_pp_zc_destroy(struct page_pool *pp)
864864
{
865865
struct io_zcrx_ifq *ifq = io_pp_to_ifq(pp);
866-
struct io_zcrx_area *area = ifq->area;
867866

868-
if (WARN_ON_ONCE(area->free_count != area->nia.num_niovs))
869-
return;
870867
percpu_ref_put(&ifq->ctx->refs);
871868
}
872869

0 commit comments

Comments
 (0)