Skip to content

Commit 32c2d33

Browse files
Hao Xuaxboe
authored andcommitted
io_uring: fix off-by-one in BUILD_BUG_ON check of __REQ_F_LAST_BIT
Build check of __REQ_F_LAST_BIT should be larger than, not equal or larger than. It's perfectly valid to have __REQ_F_LAST_BIT be 32, as that means that the last valid bit is 31 which does fit in the type. Signed-off-by: Hao Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 2ae2eb9 commit 32c2d33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10863,7 +10863,7 @@ static int __init io_uring_init(void)
1086310863
BUILD_BUG_ON(SQE_VALID_FLAGS >= (1 << 8));
1086410864

1086510865
BUILD_BUG_ON(ARRAY_SIZE(io_op_defs) != IORING_OP_LAST);
10866-
BUILD_BUG_ON(__REQ_F_LAST_BIT >= 8 * sizeof(int));
10866+
BUILD_BUG_ON(__REQ_F_LAST_BIT > 8 * sizeof(int));
1086710867

1086810868
req_cachep = KMEM_CACHE(io_kiocb, SLAB_HWCACHE_ALIGN | SLAB_PANIC |
1086910869
SLAB_ACCOUNT);

0 commit comments

Comments
 (0)