mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 11:06:41 -05:00
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
This commit is contained in:
@@ -698,6 +698,8 @@ struct io_kiocb {
|
||||
struct hlist_node hash_node;
|
||||
/* For IOPOLL setup queues, with hybrid polling */
|
||||
u64 iopoll_start;
|
||||
/* for private io_kiocb freeing */
|
||||
struct rcu_head rcu_head;
|
||||
};
|
||||
/* internal polling, see IORING_FEAT_FAST_POLL */
|
||||
struct async_poll *apoll;
|
||||
|
||||
@@ -1666,12 +1666,11 @@ static void io_iopoll_req_issued(struct io_kiocb *req, unsigned int issue_flags)
|
||||
|
||||
io_req_flags_t io_file_get_flags(struct file *file)
|
||||
{
|
||||
struct inode *inode = file_inode(file);
|
||||
io_req_flags_t res = 0;
|
||||
|
||||
BUILD_BUG_ON(REQ_F_ISREG_BIT != REQ_F_SUPPORT_NOWAIT_BIT + 1);
|
||||
|
||||
if (S_ISREG(inode->i_mode) && !(inode->i_flags & S_ANON_INODE))
|
||||
if (S_ISREG(file_inode(file)->i_mode))
|
||||
res |= REQ_F_ISREG;
|
||||
if ((file->f_flags & O_NONBLOCK) || (file->f_mode & FMODE_NOWAIT))
|
||||
res |= REQ_F_SUPPORT_NOWAIT;
|
||||
|
||||
@@ -82,7 +82,7 @@ static void io_msg_tw_complete(struct io_kiocb *req, io_tw_token_t tw)
|
||||
spin_unlock(&ctx->msg_lock);
|
||||
}
|
||||
if (req)
|
||||
kmem_cache_free(req_cachep, req);
|
||||
kfree_rcu(req, rcu_head);
|
||||
percpu_ref_put(&ctx->refs);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ static int io_msg_remote_post(struct io_ring_ctx *ctx, struct io_kiocb *req,
|
||||
int res, u32 cflags, u64 user_data)
|
||||
{
|
||||
if (!READ_ONCE(ctx->submitter_task)) {
|
||||
kmem_cache_free(req_cachep, req);
|
||||
kfree_rcu(req, rcu_head);
|
||||
return -EOWNERDEAD;
|
||||
}
|
||||
req->opcode = IORING_OP_NOP;
|
||||
|
||||
@@ -863,10 +863,7 @@ static int io_pp_zc_init(struct page_pool *pp)
|
||||
static void io_pp_zc_destroy(struct page_pool *pp)
|
||||
{
|
||||
struct io_zcrx_ifq *ifq = io_pp_to_ifq(pp);
|
||||
struct io_zcrx_area *area = ifq->area;
|
||||
|
||||
if (WARN_ON_ONCE(area->free_count != area->nia.num_niovs))
|
||||
return;
|
||||
percpu_ref_put(&ifq->ctx->refs);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user