diff options
author | John Garry <john.g.garry@oracle.com> | 2024-07-19 11:29:05 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-07-19 09:32:49 -0600 |
commit | cce496de061d09794825b7c7c7d57faca4772d82 (patch) | |
tree | 172d8859649d3b2524deae6d39caf84842026ac5 | |
parent | 55177adf1837bc56f878f7f6f7123947a2088148 (diff) |
block: Catch possible entries missing from blk_queue_flag_name[]
Assert that we are not missing flag entries in blk_queue_flag_name[].
Signed-off-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240719112912.3830443-9-john.g.garry@oracle.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r-- | block/blk-mq-debugfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index 866e8c6bebd0..d28784c1957f 100644 --- a/block/blk-mq-debugfs.c +++ b/block/blk-mq-debugfs.c @@ -5,6 +5,7 @@ #include <linux/kernel.h> #include <linux/blkdev.h> +#include <linux/build_bug.h> #include <linux/debugfs.h> #include "blk.h" @@ -99,6 +100,7 @@ static int queue_state_show(void *data, struct seq_file *m) { struct request_queue *q = data; + BUILD_BUG_ON(ARRAY_SIZE(blk_queue_flag_name) != QUEUE_FLAG_MAX); blk_flags_show(m, q->queue_flags, blk_queue_flag_name, ARRAY_SIZE(blk_queue_flag_name)); seq_puts(m, "\n"); |