From 981c2ae9bda563d16106d9dba25f4e7cc6612142 Mon Sep 17 00:00:00 2001 From: Martin Wilck Date: Apr 13 2021 20:42:37 +0000 Subject: dm mpath: switch paths in dm_blk_ioctl() code path (bsc#1167574, bsc#1175995, bsc#1184485). --- diff --git a/patches.suse/dm-mpath-switch-paths-in-dm_blk_ioctl-code-path.patch b/patches.suse/dm-mpath-switch-paths-in-dm_blk_ioctl-code-path.patch new file mode 100644 index 0000000..14e487f --- /dev/null +++ b/patches.suse/dm-mpath-switch-paths-in-dm_blk_ioctl-code-path.patch @@ -0,0 +1,41 @@ +From: Martin Wilck +Date: Mon, 20 Apr 2020 22:29:09 +0200 +Subject: dm mpath: switch paths in dm_blk_ioctl() code path +Patch-mainline: v5.8-rc1 +Git-commit: 2361ae595352dec015d14292f1b539242d8446d6 +References: bsc#1167574, bsc#1175995, bsc#1184485 + +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 +Reviewed-by: Hannes Reinecke +Signed-off-by: Mike Snitzer +--- + drivers/md/dm-mpath.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/md/dm-mpath.c ++++ b/drivers/md/dm-mpath.c +@@ -1862,7 +1862,7 @@ static int multipath_prepare_ioctl(struc + int r; + + current_pgpath = READ_ONCE(m->current_pgpath); +- if (!current_pgpath) ++ if (!current_pgpath || !test_bit(MPATHF_QUEUE_IO, &m->flags)) + current_pgpath = choose_pgpath(m, 0); + + if (current_pgpath) { diff --git a/series.conf b/series.conf index 5e837ce..713f84b 100644 --- a/series.conf +++ b/series.conf @@ -13723,6 +13723,7 @@ patches.suse/scsi-qla2xxx-Remove-return-value-from-qla_nvme_ls.patch patches.suse/scsi-lpfc-Fix-lpfc_nodelist-leak-when-processing-uns.patch patches.suse/scsi-mpt3sas-fix-reply-queue-count-in-non-rdpq-mode + patches.suse/dm-mpath-switch-paths-in-dm_blk_ioctl-code-path.patch patches.suse/0002-dm-crypt-avoid-truncating-the-logical-block-size.patch patches.suse/ext4-fix-EXT_MAX_EXTENT-INDEX-to-check-for-zeroed-eh.patch patches.suse/ext4-Avoid-freeing-inodes-on-dirty-list.patch