summaryrefslogtreecommitdiff
path: root/kernel/debug/debug_core.h
diff options
context:
space:
mode:
authorMd Haris Iqbal <haris.iqbal@linux.dev>2026-11-11 22:58:36 +0100
committerJens Axboe <axboe@kernel.dk>2026-11-18 09:06:32 -0700
commitd239710cf3e6bd5fec66766957c3752d9cfbd2c5 (patch)
tree394760ebe514555884906790676cd8927f1bc11c /kernel/debug/debug_core.h
parent495f22c5a99ac38e527294cdc4f3972718b9bee0 (diff)
block: Reject unknown status tags in error injection rules
tag_to_blk_status() returns BLK_STS_OK both for the "OK" tag and for a tag it does not recognize, so a caller cannot tell the two apart. The block error injection code (which is the sole user of this function currently) relies on error_inject_add() later to reject adding a rule with status=BLK_STS_OK. This is okay for the current state of error injection. The delay option added in the next commit makes the rule with status=OK valid, meaning the function tag_to_blk_status() now needs to explicitly match BLK_STS_OK for it, and fail for a tag it does not recognize. Hence make tag_to_blk_status() take a second param to update the matched status, and return true in case of a successful match. If a match is not found, the function tag_to_blk_status() returns false and *status remains unchanged. A repeated status= where an invalid tag comes first is now rejected instead of being overridden by the later one. Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Md Haris Iqbal <haris.iqbal@linux.dev> Reviewed-by: Christoph Hellwig <hch@lst.de> Link: https://patch.msgid.link/20261111215838.103356-2-haris.iqbal@linux.dev Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'kernel/debug/debug_core.h')
0 files changed, 0 insertions, 0 deletions