]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
dm mpath: switch paths in dm_blk_ioctl() code path
authorMartin Wilck <mwilck@suse.com>
Mon, 20 Apr 2020 20:29:09 +0000 (22:29 +0200)
committerKhalid Elmously <khalid.elmously@canonical.com>
Sat, 8 Aug 2020 05:53:12 +0000 (01:53 -0400)
commit2879f37be41e3b015dcb4d409df55ad58e547e80
tree0fd5b04261ef1ff831a4b5c31cca3cbe6cf525ac
parent3fdcef497b9784b9c3c493f3d0fd60bd7bfaa239
dm mpath: switch paths in dm_blk_ioctl() code path

BugLink: https://bugs.launchpad.net/bugs/1885322
[ Upstream commit 2361ae595352dec015d14292f1b539242d8446d6 ]

SCSI LUN passthrough code such as qemu's "scsi-block" device model
pass every IO to the host via SG_IO ioctls. Currently, dm-multipath
calls choose_pgpath() only in the block IO code path, not in the ioctl
code path (unless current_pgpath is NULL). This has the effect that no
path switching and thus no load balancing is done for SCSI-passthrough
IO, unless the active path fails.

Fix this by using the same logic in multipath_prepare_ioctl() as in
multipath_clone_and_map().

Note: The allegedly best path selection algorithm, service-time,
still wouldn't work perfectly, because the io size of the current
request is always set to 0. Changing that for the IO passthrough
case would require the ioctl cmd and arg to be passed to dm's
prepare_ioctl() method.

Signed-off-by: Martin Wilck <mwilck@suse.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
drivers/md/dm-mpath.c