mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-17 22:23:45 -04:00
block: Catch possible entries missing from cmd_flag_name[]
Add a BUILD_BUG_ON() call to ensure that we are not missing entries in cmd_flag_name[]. Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: John Garry <john.g.garry@oracle.com> Link: https://lore.kernel.org/r/20240719112912.3830443-13-john.g.garry@oracle.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -281,6 +281,8 @@ int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq)
|
||||
const enum req_op op = req_op(rq);
|
||||
const char *op_str = blk_op_str(op);
|
||||
|
||||
BUILD_BUG_ON(ARRAY_SIZE(cmd_flag_name) != __REQ_NR_BITS);
|
||||
|
||||
seq_printf(m, "%p {.op=", rq);
|
||||
if (strcmp(op_str, "UNKNOWN") == 0)
|
||||
seq_printf(m, "%u", op);
|
||||
|
||||
Reference in New Issue
Block a user