Skip to content

Commit 8a47e33

Browse files
johnpgarryaxboe
authored andcommitted
block: Catch possible entries missing from rqf_name[]
Add a BUILD_BUG_ON() call to ensure that we are not missing entries in rqf_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-16-john.g.garry@oracle.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 2d61a6c commit 8a47e33

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

block/blk-mq-debugfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ int __blk_mq_debugfs_rq_show(struct seq_file *m, struct request *rq)
282282
const char *op_str = blk_op_str(op);
283283

284284
BUILD_BUG_ON(ARRAY_SIZE(cmd_flag_name) != __REQ_NR_BITS);
285+
BUILD_BUG_ON(ARRAY_SIZE(rqf_name) != __RQF_BITS);
285286

286287
seq_printf(m, "%p {.op=", rq);
287288
if (strcmp(op_str, "UNKNOWN") == 0)

include/linux/blk-mq.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ typedef enum rq_end_io_ret (rq_end_io_fn)(struct request *, blk_status_t);
2727
* request flags */
2828
typedef __u32 __bitwise req_flags_t;
2929

30+
/* Keep rqf_name[] in sync with the definitions below */
3031
enum {
3132
/* drive already may have started this one */
3233
__RQF_STARTED,

0 commit comments

Comments
 (0)