]> git.baikalelectronics.ru Git - kernel.git/commit
block: null_blk: Fix handling of fake timeout request
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Tue, 14 Mar 2023 04:11:05 +0000 (13:11 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:33:47 +0000 (13:33 +0100)
commit24170376ece885185ee9e5e18f5bbb5ee32a0674
tree160af364195dd54c0c3c59ffdb1dc62cb3280d29
parent7efa32f298e86132c3c6d9b290165ae4cff40dc8
block: null_blk: Fix handling of fake timeout request

[ Upstream commit 13a666cf1eef31fc86009ef4260986725a9b566f ]

When injecting a fake timeout into the null_blk driver using
fail_io_timeout, the request timeout handler does not execute
blk_mq_complete_request(), so the complete callback is never executed
for a timedout request.

The null_blk driver also has a driver-specific fake timeout mechanism
which does not have this problem. Fix the problem with fail_io_timeout
by using the same meachanism as null_blk internal timeout feature, using
the fake_timeout field of null_blk commands.

Reported-by: Akinobu Mita <akinobu.mita@gmail.com>
Fixes: 5d6492a132de ("null_blk: fix command timeout completion handling")
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20230314041106.19173-2-damien.lemoal@opensource.wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/block/null_blk/main.c