Skip to content

Commit a0debc4

Browse files
committed
Merge tag 'io_uring-6.0-2022-09-29' of git://git.kernel.dk/linux
Pull io_uring fixes from Jens Axboe: "Two fixes that should go into 6.0: - Tweak the single issuer logic to register the task at creation, rather than at first submit. SINGLE_ISSUER was added for 6.0, and after some discussion on this, we decided to make it a bit stricter while it's still possible to do so (Dylan). - Stefan from Samba had some doubts on the level triggered poll that was added for this release. Rather than attempt to mess around with it now, just do the quick one-liner to disable it for release and we have time to discuss and change it for 6.1 instead (me)" * tag 'io_uring-6.0-2022-09-29' of git://git.kernel.dk/linux: io_uring/poll: disable level triggered poll io_uring: register single issuer task at creation
2 parents d649d2c + d59bd74 commit a0debc4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

io_uring/io_uring.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3357,6 +3357,10 @@ static __cold int io_uring_create(unsigned entries, struct io_uring_params *p,
33573357
goto err;
33583358
}
33593359

3360+
if (ctx->flags & IORING_SETUP_SINGLE_ISSUER
3361+
&& !(ctx->flags & IORING_SETUP_R_DISABLED))
3362+
ctx->submitter_task = get_task_struct(current);
3363+
33603364
file = io_uring_get_file(ctx);
33613365
if (IS_ERR(file)) {
33623366
ret = PTR_ERR(file);
@@ -3548,6 +3552,9 @@ static int io_register_enable_rings(struct io_ring_ctx *ctx)
35483552
if (!(ctx->flags & IORING_SETUP_R_DISABLED))
35493553
return -EBADFD;
35503554

3555+
if (ctx->flags & IORING_SETUP_SINGLE_ISSUER && !ctx->submitter_task)
3556+
ctx->submitter_task = get_task_struct(current);
3557+
35513558
if (ctx->restrictions.registered)
35523559
ctx->restricted = 1;
35533560

io_uring/poll.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ int io_poll_add_prep(struct io_kiocb *req, const struct io_uring_sqe *sqe)
857857
if (sqe->buf_index || sqe->off || sqe->addr)
858858
return -EINVAL;
859859
flags = READ_ONCE(sqe->len);
860-
if (flags & ~(IORING_POLL_ADD_MULTI|IORING_POLL_ADD_LEVEL))
860+
if (flags & ~IORING_POLL_ADD_MULTI)
861861
return -EINVAL;
862862
if ((flags & IORING_POLL_ADD_MULTI) && (req->flags & REQ_F_CQE_SKIP))
863863
return -EINVAL;

0 commit comments

Comments
 (0)