Skip to content

Commit cce496d

Browse files
johnpgarryaxboe
authored andcommitted
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>
1 parent 55177ad commit cce496d

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

block/blk-mq-debugfs.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <linux/kernel.h>
77
#include <linux/blkdev.h>
8+
#include <linux/build_bug.h>
89
#include <linux/debugfs.h>
910

1011
#include "blk.h"
@@ -99,6 +100,7 @@ static int queue_state_show(void *data, struct seq_file *m)
99100
{
100101
struct request_queue *q = data;
101102

103+
BUILD_BUG_ON(ARRAY_SIZE(blk_queue_flag_name) != QUEUE_FLAG_MAX);
102104
blk_flags_show(m, q->queue_flags, blk_queue_flag_name,
103105
ARRAY_SIZE(blk_queue_flag_name));
104106
seq_puts(m, "\n");

0 commit comments

Comments
 (0)