Files
twx-linux/include/linux
Yufen Yu 69409854ba dm mpath: fix missing call of path selector type->end_io
[ Upstream commit 5de719e3d0 ]

After commit 396eaf21ee ("blk-mq: improve DM's blk-mq IO merging via
blk_insert_cloned_request feedback"), map_request() will requeue the tio
when issued clone request return BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE.

Thus, if device driver status is error, a tio may be requeued multiple
times until the return value is not DM_MAPIO_REQUEUE.  That means
type->start_io may be called multiple times, while type->end_io is only
called when IO complete.

In fact, even without commit 396eaf21ee, setup_clone() failure can
also cause tio requeue and associated missed call to type->end_io.

The service-time path selector selects path based on in_flight_size,
which is increased by st_start_io() and decreased by st_end_io().
Missed calls to st_end_io() can lead to in_flight_size count error and
will cause the selector to make the wrong choice.  In addition,
queue-length path selector will also be affected.

To fix the problem, call type->end_io in ->release_clone_rq before tio
requeue.  map_info is passed to ->release_clone_rq() for map_request()
error path that result in requeue.

Fixes: 396eaf21ee ("blk-mq: improve DM's blk-mq IO merging via blk_insert_cloned_request feedback")
Cc: stable@vger.kernl.org
Signed-off-by: Yufen Yu <yuyufen@huawei.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-09-16 08:22:12 +02:00
..
2019-04-20 09:16:05 +02:00
2019-07-03 13:14:48 +02:00
2018-08-22 10:52:48 -07:00
2019-08-09 17:52:28 +02:00
2019-05-31 06:46:18 -07:00
2019-05-04 09:20:11 +02:00
2018-08-22 10:52:45 -07:00
2018-08-22 10:52:46 -07:00
2019-06-11 12:20:52 +02:00
2019-04-17 08:38:45 +02:00
2018-11-13 11:08:51 -08:00
2019-06-17 19:51:56 +02:00