Pavel Begunkov
d92d00861e
io_uring: fix sleeping under spin in __io_clean_op
...
[ Upstream commit 9d5c8190683a462dbc787658467a0da17011ea5f ]
[ 27.629441] BUG: sleeping function called from invalid context
at fs/file.c:402
[ 27.631317] in_atomic(): 1, irqs_disabled(): 1, non_block: 0,
pid: 1012, name: io_wqe_worker-0
[ 27.633220] 1 lock held by io_wqe_worker-0/1012:
[ 27.634286] #0 : ffff888105e26c98 (&ctx->completion_lock)
{....}-{2:2}, at: __io_req_complete.part.102+0x30/0x70
[ 27.649249] Call Trace:
[ 27.649874] dump_stack+0xac/0xe3
[ 27.650666] ___might_sleep+0x284/0x2c0
[ 27.651566] put_files_struct+0xb8/0x120
[ 27.652481] __io_clean_op+0x10c/0x2a0
[ 27.653362] __io_cqring_fill_event+0x2c1/0x350
[ 27.654399] __io_req_complete.part.102+0x41/0x70
[ 27.655464] io_openat2+0x151/0x300
[ 27.656297] io_issue_sqe+0x6c/0x14e0
[ 27.660991] io_wq_submit_work+0x7f/0x240
[ 27.662890] io_worker_handle_work+0x501/0x8a0
[ 27.664836] io_wqe_worker+0x158/0x520
[ 27.667726] kthread+0x134/0x180
[ 27.669641] ret_from_fork+0x1f/0x30
Instead of cleaning files on overflow, return back overflow cancellation
into io_uring_cancel_files(). Previously it was racy to clean
REQ_F_OVERFLOW flag, but we got rid of it, and can do it through
repetitive attempts targeting all matching requests.
Cc: stable@vger.kernel.org # 5.9+
Reported-by: Abaci <abaci@linux.alibaba.com>
Reported-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-30 13:55:19 +01:00
..
2020-12-01 21:40:47 +01:00
2020-10-24 12:26:05 -07:00
2020-10-24 12:26:05 -07:00
2020-12-08 15:59:25 -08:00
2020-10-16 11:11:22 -07:00
2020-09-18 16:45:50 -04:00
2021-01-06 14:56:52 +01:00
2021-01-27 11:55:06 +01:00
2021-01-27 11:55:22 +01:00
2021-01-06 14:56:55 +01:00
2021-01-27 11:55:13 +01:00
2020-10-16 11:11:19 -07:00
2020-09-18 16:45:50 -04:00
2020-12-26 16:02:43 +01:00
2020-10-30 08:37:39 +01:00
2020-10-15 18:42:13 -07:00
2020-08-07 11:33:22 -07:00
2020-11-25 16:55:02 +01:00
2020-09-18 16:45:50 -04:00
2020-12-30 11:53:46 +01:00
2020-12-26 16:02:38 +01:00
2020-10-24 12:26:05 -07:00
2021-01-19 18:27:31 +01:00
2021-01-06 14:56:54 +01:00
2020-09-18 16:45:50 -04:00
2021-01-09 13:46:24 +01:00
2020-12-01 00:21:10 +01:00
2020-10-29 17:22:59 -05:00
2020-10-29 17:22:59 -05:00
2020-09-18 16:45:50 -04:00
2020-08-12 10:57:56 -07:00
2020-11-04 08:52:46 -08:00
2020-10-29 17:22:59 -05:00
2020-11-19 22:38:29 -05:00
2021-01-06 14:56:49 +01:00
2020-12-30 11:54:18 +01:00
2021-01-27 11:55:29 +01:00
2020-12-30 11:53:30 +01:00
2020-09-18 16:45:50 -04:00
2021-01-19 18:27:31 +01:00
2020-12-30 11:53:45 +01:00
2021-01-27 11:55:05 +01:00
2020-10-24 12:26:05 -07:00
2021-01-17 14:16:59 +01:00
2020-10-24 12:26:05 -07:00
2020-11-14 11:26:04 -08:00
2020-09-22 23:39:45 -04:00
2020-08-04 15:01:58 -04:00
2020-12-30 11:54:16 +01:00
2021-01-27 11:55:14 +01:00
2020-08-23 17:36:59 -05:00
2020-09-18 16:45:50 -04:00
2020-09-18 16:45:50 -04:00
2021-01-06 14:56:53 +01:00
2020-10-16 11:11:22 -07:00
2021-01-06 14:56:52 +01:00
2020-10-24 12:26:05 -07:00
2020-10-24 12:26:05 -07:00
2020-10-02 12:02:30 +02:00
2020-09-18 16:45:50 -04:00
2020-12-30 11:54:17 +01:00
2020-10-24 12:26:05 -07:00
2020-10-24 12:26:05 -07:00
2020-09-10 14:03:31 -07:00
2020-10-15 15:11:56 -07:00
2020-07-21 16:02:41 -07:00
2020-11-19 15:17:50 -08:00
2021-01-17 14:17:03 +01:00
2020-11-10 16:53:07 -08:00
2020-10-16 11:11:21 -07:00
2020-10-29 17:22:59 -05:00
2020-08-24 08:49:13 +10:00
2020-10-05 10:38:33 -06:00
2020-10-18 09:27:09 -07:00
2020-12-06 10:19:07 -08:00
2020-10-14 14:54:45 -07:00
2020-10-19 14:28:30 -07:00
2020-07-29 16:14:27 +02:00
2020-10-15 15:03:10 -07:00
2020-12-30 11:54:00 +01:00
2021-01-09 13:46:24 +01:00
2021-01-06 14:56:53 +01:00
2020-10-17 15:05:30 -06:00
2021-01-30 13:55:18 +01:00
2020-08-23 17:36:59 -05:00
2020-10-13 18:38:27 -07:00
2020-07-29 16:14:27 +02:00
2021-01-27 11:54:53 +01:00
2020-08-23 17:36:59 -05:00
2020-08-04 21:02:38 -04:00
2020-12-30 11:53:49 +01:00
2020-09-22 23:45:57 -04:00
2021-01-30 13:55:19 +01:00
2020-11-04 10:22:56 -07:00
2020-12-30 11:54:03 +01:00
2020-07-31 08:16:01 +02:00
2020-08-07 11:33:24 -07:00
2020-10-05 13:37:04 +02:00
2020-11-22 10:48:22 -08:00
2020-08-23 17:36:59 -05:00
2020-10-23 11:33:41 -07:00
2020-10-24 12:26:05 -07:00
2021-01-19 18:27:32 +01:00
2020-12-30 11:54:24 +01:00
2021-01-27 11:55:29 +01:00
2021-01-06 14:56:54 +01:00
2020-12-30 11:54:02 +01:00
2020-10-23 11:33:41 -07:00
2020-07-31 08:16:00 +02:00
2020-10-15 09:48:49 -07:00
2021-01-19 18:27:27 +01:00
2020-11-15 22:12:53 -05:00
2020-08-23 17:36:59 -05:00
2020-10-24 12:40:18 -07:00
2020-09-26 22:55:05 -04:00
2020-08-27 16:06:47 -04:00
2020-11-10 16:53:11 -08:00
2020-10-16 11:11:22 -07:00
2020-07-31 08:16:01 +02:00
2020-10-13 18:38:27 -07:00