@@ -971,6 +971,7 @@ static ssize_t io_import_iovec(int rw, struct io_kiocb *req,
971
971
static int io_setup_async_rw (struct io_kiocb * req , const struct iovec * iovec ,
972
972
const struct iovec * fast_iov ,
973
973
struct iov_iter * iter , bool force );
974
+ static void io_req_drop_files (struct io_kiocb * req );
974
975
975
976
static struct kmem_cache * req_cachep ;
976
977
@@ -991,8 +992,7 @@ EXPORT_SYMBOL(io_uring_get_socket);
991
992
992
993
static inline void io_clean_op (struct io_kiocb * req )
993
994
{
994
- if (req -> flags & (REQ_F_NEED_CLEANUP | REQ_F_BUFFER_SELECTED |
995
- REQ_F_INFLIGHT ))
995
+ if (req -> flags & (REQ_F_NEED_CLEANUP | REQ_F_BUFFER_SELECTED ))
996
996
__io_clean_op (req );
997
997
}
998
998
@@ -1256,6 +1256,8 @@ static void io_req_clean_work(struct io_kiocb *req)
1256
1256
free_fs_struct (fs );
1257
1257
req -> work .flags &= ~IO_WQ_WORK_FS ;
1258
1258
}
1259
+ if (req -> flags & REQ_F_INFLIGHT )
1260
+ io_req_drop_files (req );
1259
1261
1260
1262
io_put_identity (req -> task -> io_uring , req );
1261
1263
}
@@ -5960,9 +5962,6 @@ static void __io_clean_op(struct io_kiocb *req)
5960
5962
}
5961
5963
req -> flags &= ~REQ_F_NEED_CLEANUP ;
5962
5964
}
5963
-
5964
- if (req -> flags & REQ_F_INFLIGHT )
5965
- io_req_drop_files (req );
5966
5965
}
5967
5966
5968
5967
static int io_issue_sqe (struct io_kiocb * req , bool force_nonblock ,
@@ -8700,6 +8699,8 @@ static bool io_uring_cancel_files(struct io_ring_ctx *ctx,
8700
8699
break ;
8701
8700
/* cancel this request, or head link requests */
8702
8701
io_attempt_cancel (ctx , cancel_req );
8702
+ io_cqring_overflow_flush (ctx , true, task , files );
8703
+
8703
8704
io_put_req (cancel_req );
8704
8705
/* cancellations _may_ trigger task work */
8705
8706
io_run_task_work ();
0 commit comments