diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2025-03-31 08:54:00 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-03-31 07:07:34 -0600 |
commit | 697b2876ac037545ba2761e2ffe9a5c2af6424e6 (patch) | |
tree | af8da177c4b0346afa7a925eaafc65ddf7cb4006 /io_uring | |
parent | f28a71bc979392234cc110cd1e6787fb5b432116 (diff) |
io_uring: add req flag invariant build assertion
We're caching some of file related request flags in a tricky way, put
a build check to make sure flags don't get reshuffled.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/9877577b83c25dd78224a8274f799187e7ec7639.1743407551.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring')
-rw-r--r-- | io_uring/io_uring.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index e4484a03e033..a4065e3d13d0 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1643,6 +1643,8 @@ io_req_flags_t io_file_get_flags(struct file *file) { io_req_flags_t res = 0; + BUILD_BUG_ON(REQ_F_ISREG_BIT != REQ_F_SUPPORT_NOWAIT_BIT + 1); + if (S_ISREG(file_inode(file)->i_mode)) res |= REQ_F_ISREG; if ((file->f_flags & O_NONBLOCK) || (file->f_mode & FMODE_NOWAIT)) |