Skip to content

Commit 437c233

Browse files
isilenceaxboe
authored andcommitted
io_uring: fix unexpected placement on same size resizing
There might be many reasons why a user is resizing a ring, e.g. moving to huge pages or for some memory compaction using IORING_SETUP_NO_MMAP. Don't bypass resizing, the user will definitely be surprised seeing 0 while the rings weren't actually moved to a new place. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent be7cab4 commit 437c233

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

io_uring/register.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -421,13 +421,6 @@ static int io_register_resize_rings(struct io_ring_ctx *ctx, void __user *arg)
421421
if (unlikely(ret))
422422
return ret;
423423

424-
/* nothing to do, but copy params back */
425-
if (p.sq_entries == ctx->sq_entries && p.cq_entries == ctx->cq_entries) {
426-
if (copy_to_user(arg, &p, sizeof(p)))
427-
return -EFAULT;
428-
return 0;
429-
}
430-
431424
size = rings_size(p.flags, p.sq_entries, p.cq_entries,
432425
&sq_array_offset);
433426
if (size == SIZE_MAX)

0 commit comments

Comments
 (0)