Skip to content

Commit 7fbeb95

Browse files
isilenceaxboe
authored andcommitted
io_uring: add missing io_req_cancelled()
fallocate_finish() is missing cancellation check. Add it. It's safe to do that, as only flags setup and sqe fields copy are done before it gets into __io_fallocate(). Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent db70e26 commit 7fbeb95

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/io_uring.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,6 +2517,9 @@ static void io_fallocate_finish(struct io_wq_work **workptr)
25172517
struct io_kiocb *nxt = NULL;
25182518
int ret;
25192519

2520+
if (io_req_cancelled(req))
2521+
return;
2522+
25202523
ret = vfs_fallocate(req->file, req->sync.mode, req->sync.off,
25212524
req->sync.len);
25222525
if (ret < 0)
@@ -2904,6 +2907,7 @@ static void io_close_finish(struct io_wq_work **workptr)
29042907
struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work);
29052908
struct io_kiocb *nxt = NULL;
29062909

2910+
/* not cancellable, don't do io_req_cancelled() */
29072911
__io_close_finish(req, &nxt);
29082912
if (nxt)
29092913
io_wq_assign_next(workptr, nxt);

0 commit comments

Comments
 (0)