projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9c7741
)
block: add a BUILD_BUG_ON() for adding more bio flags than we have space
author
Jens Axboe
<axboe@kernel.dk>
Mon, 9 Jan 2023 17:45:56 +0000
(10:45 -0700)
committer
Jens Axboe
<axboe@kernel.dk>
Sun, 29 Jan 2023 22:18:33 +0000
(15:18 -0700)
We have BIO_FLAG_LAST in the enum for bio specific flags, but it's
not used to check that we're not exceeding the size of them. Add
such a check.
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/bio.c
patch
|
blob
|
blame
|
history
diff --git
a/block/bio.c
b/block/bio.c
index ab59a491a883e3b657edc27b8f8cfd042843f9e0..d7fbc7adfc50aa74475f7f14b5ad09c533f759e2 100644
(file)
--- a/
block/bio.c
+++ b/
block/bio.c
@@
-1792,6
+1792,8
@@
static int __init init_bio(void)
{
int i;
+ BUILD_BUG_ON(BIO_FLAG_LAST > 8 * sizeof_field(struct bio, bi_flags));
+
bio_integrity_init();
for (i = 0; i < ARRAY_SIZE(bvec_slabs); i++) {