Skip to content

Commit 697b287

Browse files
isilenceaxboe
authored andcommitted
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>
1 parent f28a71b commit 697b287

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

io_uring/io_uring.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,8 @@ io_req_flags_t io_file_get_flags(struct file *file)
16431643
{
16441644
io_req_flags_t res = 0;
16451645

1646+
BUILD_BUG_ON(REQ_F_ISREG_BIT != REQ_F_SUPPORT_NOWAIT_BIT + 1);
1647+
16461648
if (S_ISREG(file_inode(file)->i_mode))
16471649
res |= REQ_F_ISREG;
16481650
if ((file->f_flags & O_NONBLOCK) || (file->f_mode & FMODE_NOWAIT))

0 commit comments

Comments
 (0)