File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -4318,11 +4318,13 @@ static bool __io_poll_remove_one(struct io_kiocb *req,
4318
4318
4319
4319
static bool io_poll_remove_one (struct io_kiocb * req )
4320
4320
{
4321
+ struct async_poll * apoll = NULL ;
4321
4322
bool do_complete ;
4322
4323
4323
4324
if (req -> opcode == IORING_OP_POLL_ADD ) {
4324
4325
do_complete = __io_poll_remove_one (req , & req -> poll );
4325
4326
} else {
4327
+ apoll = req -> apoll ;
4326
4328
/* non-poll requests have submit ref still */
4327
4329
do_complete = __io_poll_remove_one (req , & req -> apoll -> poll );
4328
4330
if (do_complete )
@@ -4331,6 +4333,14 @@ static bool io_poll_remove_one(struct io_kiocb *req)
4331
4333
4332
4334
hash_del (& req -> hash_node );
4333
4335
4336
+ if (apoll ) {
4337
+ /*
4338
+ * restore ->work because we need to call io_req_work_drop_env.
4339
+ */
4340
+ memcpy (& req -> work , & apoll -> work , sizeof (req -> work ));
4341
+ kfree (apoll );
4342
+ }
4343
+
4334
4344
if (do_complete ) {
4335
4345
io_cqring_fill_event (req , - ECANCELED );
4336
4346
io_commit_cqring (req -> ctx );
You can’t perform that action at this time.
0 commit comments