diff options
author | Jens Axboe <axboe@kernel.dk> | 2023-01-09 18:45:56 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-01-29 23:18:33 +0100 |
commit | a3df2e456c0f9db4cc7f2013eb0beb853945b937 (patch) | |
tree | 42f3c52ad690e18c0749e5b4e52963409d24a1d4 /block/bio.c | |
parent | block: save user max_sectors limit (diff) | |
download | linux-a3df2e456c0f9db4cc7f2013eb0beb853945b937.tar.xz linux-a3df2e456c0f9db4cc7f2013eb0beb853945b937.zip |
block: add a BUILD_BUG_ON() for adding more bio flags than we have space
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>
Diffstat (limited to 'block/bio.c')
-rw-r--r-- | block/bio.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/bio.c b/block/bio.c index ab59a491a883..d7fbc7adfc50 100644 --- 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++) { |