io_ddir: return appropriate string for DDIR_INVAL
authorVincent Fu <vincent.fu@samsung.com>
Fri, 3 Dec 2021 21:10:10 +0000 (21:10 +0000)
committerJens Axboe <axboe@kernel.dk>
Fri, 3 Dec 2021 21:46:33 +0000 (14:46 -0700)
commit5ea6ec73f15e7eaa4fda497f76fd9dacba36c284
tree602945c3693de1ed09b8bc21a4eea034655935ac
parentfd1d8e0ab3dc852193037a3acebcf8b8bdbcd9c5
io_ddir: return appropriate string for DDIR_INVAL

When looking up the appropriate name for a data direction, make sure the
array index is non-negative. This ensures that we return an appropriate
string for DDIR_INVAL.

Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
Link: https://lore.kernel.org/r/20211203211050.51241-2-vincent.fu@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_ddir.h