summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-02-16 01:01:18 +0300
committerJens Axboe <axboe@kernel.dk>2020-02-16 10:09:37 -0700
commit7fbeb95d0f68e21e6ca61284f1ac681630976947 (patch)
tree0c91a7ee827647a86f9131bf3ac50c27cdba11ef /fs/io_uring.c
parentdb70e26e33eef1b148ca1c9f50de92203ec7e82e (diff)
downloadlwn-7fbeb95d0f68e21e6ca61284f1ac681630976947.tar.gz
lwn-7fbeb95d0f68e21e6ca61284f1ac681630976947.zip
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 <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5a826017ebb8..29565d82291f 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2517,6 +2517,9 @@ static void io_fallocate_finish(struct io_wq_work **workptr)
struct io_kiocb *nxt = NULL;
int ret;
+ if (io_req_cancelled(req))
+ return;
+
ret = vfs_fallocate(req->file, req->sync.mode, req->sync.off,
req->sync.len);
if (ret < 0)
@@ -2904,6 +2907,7 @@ static void io_close_finish(struct io_wq_work **workptr)
struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work);
struct io_kiocb *nxt = NULL;
+ /* not cancellable, don't do io_req_cancelled() */
__io_close_finish(req, &nxt);
if (nxt)
io_wq_assign_next(workptr, nxt);