@@ -1025,6 +1025,7 @@ static ssize_t io_import_iovec(int rw, struct io_kiocb *req,
1025
1025
static int io_setup_async_rw (struct io_kiocb * req , const struct iovec * iovec ,
1026
1026
const struct iovec * fast_iov ,
1027
1027
struct iov_iter * iter , bool force );
1028
+ static void io_req_drop_files (struct io_kiocb * req );
1028
1029
1029
1030
static struct kmem_cache * req_cachep ;
1030
1031
@@ -1048,8 +1049,7 @@ EXPORT_SYMBOL(io_uring_get_socket);
1048
1049
1049
1050
static inline void io_clean_op (struct io_kiocb * req )
1050
1051
{
1051
- if (req -> flags & (REQ_F_NEED_CLEANUP | REQ_F_BUFFER_SELECTED |
1052
- REQ_F_INFLIGHT ))
1052
+ if (req -> flags & (REQ_F_NEED_CLEANUP | REQ_F_BUFFER_SELECTED ))
1053
1053
__io_clean_op (req );
1054
1054
}
1055
1055
@@ -1394,6 +1394,8 @@ static void io_req_clean_work(struct io_kiocb *req)
1394
1394
free_fs_struct (fs );
1395
1395
req -> work .flags &= ~IO_WQ_WORK_FS ;
1396
1396
}
1397
+ if (req -> flags & REQ_F_INFLIGHT )
1398
+ io_req_drop_files (req );
1397
1399
1398
1400
io_put_identity (req -> task -> io_uring , req );
1399
1401
}
@@ -6230,9 +6232,6 @@ static void __io_clean_op(struct io_kiocb *req)
6230
6232
}
6231
6233
req -> flags &= ~REQ_F_NEED_CLEANUP ;
6232
6234
}
6233
-
6234
- if (req -> flags & REQ_F_INFLIGHT )
6235
- io_req_drop_files (req );
6236
6235
}
6237
6236
6238
6237
static int io_issue_sqe (struct io_kiocb * req , bool force_nonblock ,
@@ -8879,6 +8878,7 @@ static void io_uring_cancel_files(struct io_ring_ctx *ctx,
8879
8878
io_wq_cancel_cb (ctx -> io_wq , io_cancel_task_cb , & cancel , true);
8880
8879
io_poll_remove_all (ctx , task , files );
8881
8880
io_kill_timeouts (ctx , task , files );
8881
+ io_cqring_overflow_flush (ctx , true, task , files );
8882
8882
/* cancellations _may_ trigger task work */
8883
8883
io_run_task_work ();
8884
8884
schedule ();
0 commit comments