summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2021-03-12 08:27:05 -0700
committerJens Axboe <axboe@kernel.dk>2021-04-11 17:41:58 -0600
commitd44f554e105b0c20e5b06b9f821bef228e04d573 (patch)
tree1e9d4b90b9702bf3f2898ace58a14effc7dfc8c9 /fs/io_uring.c
parentc9dca27dc7f9c5dc4ee4ba5b77f7584387f867fe (diff)
downloadlwn-d44f554e105b0c20e5b06b9f821bef228e04d573.tar.gz
lwn-d44f554e105b0c20e5b06b9f821bef228e04d573.zip
io_uring: don't check for io_uring_fops for fixed files
We don't allow them at registration time, so limit the check for needing inflight tracking in io_file_get() to the non-fixed path. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index d5ef9560449b..e7ddfa136860 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6212,10 +6212,12 @@ static struct file *io_file_get(struct io_submit_state *state,
} else {
trace_io_uring_file_get(ctx, fd);
file = __io_file_get(state, fd);
+
+ /* we don't allow fixed io_uring files */
+ if (file && unlikely(file->f_op == &io_uring_fops))
+ io_req_track_inflight(req);
}
- if (file && unlikely(file->f_op == &io_uring_fops))
- io_req_track_inflight(req);
return file;
}