Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'io_uring-5.14-2021-08-20' of git://git.kernel.dk/linux-block

Pull io_uring fixes from Jens Axboe:
"A few small fixes that should go into this release:

- Fix never re-assigning an initial error value for io_uring_enter()
for SQPOLL, if asked to do nothing

- Fix xa_alloc_cycle() return value checking, for cases where we have
wrapped around

- Fix for a ctx pin issue introduced in this cycle (Pavel)"

* tag 'io_uring-5.14-2021-08-20' of git://git.kernel.dk/linux-block:
io_uring: fix xa_alloc_cycle() error return value check
io_uring: pin ctx on fallback execution
io_uring: only assign io_uring_enter() SQPOLL error in actual error case

+10 -6
+10 -6
fs/io_uring.c
··· 2477 2477 struct llist_node *node = llist_del_all(&ctx->fallback_llist); 2478 2478 struct io_kiocb *req, *tmp; 2479 2479 2480 + percpu_ref_get(&ctx->refs); 2480 2481 llist_for_each_entry_safe(req, tmp, node, io_task_work.fallback_node) 2481 2482 req->io_task_work.func(req); 2483 + percpu_ref_put(&ctx->refs); 2482 2484 } 2483 2485 2484 2486 static void __io_complete_rw(struct io_kiocb *req, long res, long res2, ··· 9372 9370 if (ctx->flags & IORING_SETUP_SQPOLL) { 9373 9371 io_cqring_overflow_flush(ctx, false); 9374 9372 9375 - ret = -EOWNERDEAD; 9376 - if (unlikely(ctx->sq_data->thread == NULL)) 9373 + if (unlikely(ctx->sq_data->thread == NULL)) { 9374 + ret = -EOWNERDEAD; 9377 9375 goto out; 9376 + } 9378 9377 if (flags & IORING_ENTER_SQ_WAKEUP) 9379 9378 wake_up(&ctx->sq_data->wait); 9380 9379 if (flags & IORING_ENTER_SQ_WAIT) { ··· 9843 9840 9844 9841 ret = xa_alloc_cyclic(&ctx->personalities, &id, (void *)creds, 9845 9842 XA_LIMIT(0, USHRT_MAX), &ctx->pers_next, GFP_KERNEL); 9846 - if (!ret) 9847 - return id; 9848 - put_cred(creds); 9849 - return ret; 9843 + if (ret < 0) { 9844 + put_cred(creds); 9845 + return ret; 9846 + } 9847 + return id; 9850 9848 } 9851 9849 9852 9850 static int io_register_restrictions(struct io_ring_ctx *ctx, void __user *arg,