summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJohn Garry <john.g.garry@oracle.com>2024-07-19 11:29:07 +0000
committerJens Axboe <axboe@kernel.dk>2024-07-19 09:32:49 -0600
commit226f0f6afc3e5c8903c6e57e1f6073ad8ad189b5 (patch)
treee4e71989ec01fabea9101b0cefb39fb7b80c3114 /block
parent23827310cce7eff3477aeaeb59ea3718f5c9c633 (diff)
downloadlinux-stable-226f0f6afc3e5c8903c6e57e1f6073ad8ad189b5.tar.gz
linux-stable-226f0f6afc3e5c8903c6e57e1f6073ad8ad189b5.tar.bz2
linux-stable-226f0f6afc3e5c8903c6e57e1f6073ad8ad189b5.zip
block: Catch possible entries missing from hctx_flag_name[]
Refresh values in BLK_MQ_F_x enum, and then re-arrange members in hctx_flag_name[] to match that enum. Renumber BLK_MQ_F_ALLOC_POLICY_START_BIT to match the value refresh. Add a BUILD_BUG_ON() call to ensure that we are not missing entries in hctx_flag_name[]. Signed-off-by: John Garry <john.g.garry@oracle.com> Link: https://lore.kernel.org/r/20240719112912.3830443-11-john.g.garry@oracle.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq-debugfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c
index 85be8aa39b90..8618aa07ba2d 100644
--- a/block/blk-mq-debugfs.c
+++ b/block/blk-mq-debugfs.c
@@ -196,6 +196,9 @@ static int hctx_flags_show(void *data, struct seq_file *m)
struct blk_mq_hw_ctx *hctx = data;
const int alloc_policy = BLK_MQ_FLAG_TO_ALLOC_POLICY(hctx->flags);
+ BUILD_BUG_ON(ARRAY_SIZE(hctx_flag_name) !=
+ BLK_MQ_F_ALLOC_POLICY_START_BIT);
+
seq_puts(m, "alloc_policy=");
if (alloc_policy < ARRAY_SIZE(alloc_policy_name) &&
alloc_policy_name[alloc_policy])