Skip to contentSkip to conversation

io_uring: fix bug of wrong BUILD_BUG_ON check of __REQ_F_LAST_BIT

PATCH Applied Hao Xu 2 participants 3 messages Sep 7, 2021 – Sep 10, 2021

Subsystems (2)
lore
Share & tools
lore

Hao Xu

author
#0 lore raw

PATCH v2 1/1 io_uring: fix bug of wrong BUILD_BUG_ON check of __REQ_F_LAST_BIT

Build check of __REQ_F_LAST_BIT should be large than not equal or large than.

---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
index 2bde732a1183..d159d9204e07 100644
@@ -10643,7 +10643,7 @@ static int __init io_uring_init(void)
 	BUILD_BUG_ON(SQE_VALID_FLAGS >= (1 << 8));
 
 	BUILD_BUG_ON(ARRAY_SIZE(io_op_defs) != IORING_OP_LAST);
-	BUILD_BUG_ON(__REQ_F_LAST_BIT >= 8 * sizeof(int));
+	BUILD_BUG_ON(__REQ_F_LAST_BIT > 8 * sizeof(int));
 
 	req_cachep = KMEM_CACHE(io_kiocb, SLAB_HWCACHE_ALIGN | SLAB_PANIC |
 				SLAB_ACCOUNT);
Signature · 1 line
2.24.4
author
#1 lore raw

ping

Quoted 22 lines · Hao Xu

Build check of __REQ_F_LAST_BIT should be large than not equal or large than.

---
  fs/io_uring.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/io_uring.c +1 -1
index 2bde732a1183..d159d9204e07 100644
@@ -10643,7 +10643,7 @@ static int __init io_uring_init(void)
  	BUILD_BUG_ON(SQE_VALID_FLAGS >= (1 << 8));
 
  	BUILD_BUG_ON(ARRAY_SIZE(io_op_defs) != IORING_OP_LAST);
-	BUILD_BUG_ON(__REQ_F_LAST_BIT >= 8 * sizeof(int));
+	BUILD_BUG_ON(__REQ_F_LAST_BIT > 8 * sizeof(int));
 
  	req_cachep = KMEM_CACHE(io_kiocb, SLAB_HWCACHE_ALIGN | SLAB_PANIC |
  				SLAB_ACCOUNT);
maintainer Applied
#2 lore raw
In reply to Hao Xu
Quoted 2 lines · Hao Xu

Build check of __REQ_F_LAST_BIT should be large than not equal or large than.

Thanks, applied with a bit of commit message massaging.

Signature · 1 line
Jens Axboe