From b05147c3568a82643147f8c3f245a34a11f25526 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski Date: Fri, 26 Mar 2021 13:33:56 -0500 Subject: [PATCH] device-mapper-multipath-0.8.5-6 Change patch format to remove Git version * Patches 0001-0122 only have the patch format modified Update to the head of the upstream staging branch plus redhat patches * Patches 0123-0134 & 1036-0142 are from the upstream staging branch * Patches 0143-1046 have been submitted upstream * Patch 0156 is a Red Hat only patch. Red Hat udev rules set ID_SERIAL from 60-persistent-storage.rules instead of 55-scsi-sg3_id.rules. Multipath's parse_vpd_pg83() function needs to match the ID_SERIAL value from udev. Rename files * Previous patches 0123-0132 are now patches 1035 & 0147-0155 --- ...path.conf-manpage-uxsock_timeout-def.patch | 3 - ...find_mpe-don-t-match-with-empty-WWID.patch | 3 - ...ibmultipath-copy-mpp-hwe-from-pp-hwe.patch | 3 - ...map_present_by_uuid-fix-dm_task_crea.patch | 3 - 0005-libdmmp-tests-fix-compilation.patch | 3 - ...io-constify-some-function-parameters.patch | 3 - ...ckers-prio-allow-non-lazy-.so-loadin.patch | 3 - ...Makefiles-separate-rules-for-.so-and.patch | 3 - ...h-create-separate-.so-for-unit-tests.patch | 3 - ...bmultipath-add-linker-version-script.patch | 3 - ...athpersist-add-linker-version-script.patch | 3 - ...ibmpathcmd-add-linker-version-script.patch | 3 - ...sist-initialize-mpp-hwe-in-get_mpvec.patch | 3 - ...athd-allow-shutdown-during-configure.patch | 3 - ...-sending-READY-1-to-systemd-on-early.patch | 3 - ...nd-STOPPING-1-to-systemd-on-shutdown.patch | 3 - ...RELOADING-1-to-systemd-on-DAEMON_CON.patch | 3 - ...volatile-qualifier-for-running_state.patch | 3 - ...alize-and-fix-wait_for_state_change_.patch | 3 - ..._config_state-avoid-code-duplication.patch | 3 - ...cancel-threads-early-during-shutdown.patch | 3 - ...s-don-t-call-dm_lib_release-any-more.patch | 3 - ...mapper-refactor-libdm-version-determ.patch | 3 - ...tect-racy-libdevmapper-calls-with-a-.patch | 3 - ...stify-file-argument-in-config-parser.patch | 3 - ...vide-defaults-for-get-put-_multipath.patch | 3 - ...allow-using-libmultipath-get-put-_mu.patch | 3 - ...t_put-_multipath_config-from-libmult.patch | 3 - ...-get-put-_multipath_config-from-libm.patch | 3 - ...ltipath-add-udev-and-logsink-symbols.patch | 3 - 0031-multipath-remove-logsink-and-udev.patch | 3 - ...persist-call-libmultipath_-init-exit.patch | 3 - ...mpathpersist-remove-logsink-and-udev.patch | 3 - 0034-multipathd-remove-logsink-and-udev.patch | 3 - ...-add-Vexata-by-StorCentric-VX-arrays.patch | 3 - ...Violin-and-Nexsan-were-bought-by-Sto.patch | 3 - ...h-fix-memory-leaks-in-coalesce_paths.patch | 3 - ...replace-hidden-tab-by-space-in-hwtab.patch | 3 - ...ipathd-uxlsnr-avoid-deadlock-on-exit.patch | 3 - 0040-multipathd-Fix-liburcu-memory-leak.patch | 3 - ...handling-of-io_err_stat_attr-into-li.patch | 3 - ...vecs-desctruction-into-cleanup-funct.patch | 3 - ...-multipathd-make-some-globals-static.patch | 3 - ...threads-destruction-into-separate-fu.patch | 3 - ...conf-destruction-into-separate-funct.patch | 3 - ...pid-destruction-into-separate-functi.patch | 3 - 0047-multipathd-close-pidfile-on-exit.patch | 3 - ...elper-for-systemd-notification-at-ex.patch | 3 - ...ld-call-cleanups-in-failure-case-too.patch | 3 - ...ch_all_dmevents-check-if-waiter-is-i.patch | 3 - ...-error-message-if-config-can-t-be-lo.patch | 3 - 0052-libmultipath-add-libmp_dm_exit.patch | 3 - ...tipathd-fixup-libdm-deinitialization.patch | 3 - ..._thread_stop-check-if-logarea-is-ini.patch | 3 - ...pathd-add-cleanup_child-exit-handler.patch | 3 - ...-fix-log_thread-startup-and-teardown.patch | 3 - ...cleanup_-prio-checkers-foreign-to-li.patch | 3 - ...path-use-atexit-for-cleanup-handlers.patch | 3 - ...sist-use-atexit-for-cleanup-handlers.patch | 3 - ...ltipath-fix-leak-in-check_path_valid.patch | 3 - ...mpath-tools.supp-file-with-valgrind-.patch | 3 - ...e-libmp_verbosity-to-track-verbosity.patch | 3 - ...ntroduce-symbolic-values-for-logsink.patch | 3 - 0064-libmultipath-simplify-dlog.patch | 3 - ...d-common-code-for-k-and-command-args.patch | 3 - 0066-multipathd-sanitize-uxsock_listen.patch | 3 - ...-race-between-log_safe-and-log_threa.patch | 3 - ...-multipath-add-libmpathvalid-library.patch | 3 - ...tests-and-unit-tests-for-libmpathval.patch | 3 - ...th-add-uid-failback-for-dasd-devices.patch | 3 - ...nge-log-level-for-null-uid_attribute.patch | 3 - ...ve-fast_io_fail-defines-to-structs.h.patch | 3 - ...-eh_deadline-multipath.conf-paramete.patch | 3 - ...e-redundant-vector_free-int-configur.patch | 3 - ...factor-out-code-to-get-vpd-page-data.patch | 3 - ...ultipath-limit-reading-0xc9-vpd-page.patch | 3 - ...ath-move-logq_lock-handling-to-log.c.patch | 3 - ...ipath-protect-logarea-with-logq_lock.patch | 3 - ...vent-DSO-unloading-with-astray-check.patch | 3 - ...-force-map-reload-if-udev-incomplete.patch | 3 - ...-tools-avoid-access-to-etc-localtime.patch | 3 - ...make-sure-plugin-DSOs-use-symbol-ver.patch | 3 - ...multipath.version-add-missing-symbol.patch | 3 - ...tests-unversioned-.so-for-valgrind-t.patch | 3 - ...unit-tests-fix-memory-leaks-in-mpath.patch | 3 - ...x-Register-and-Ignore-with-0x00-SARK.patch | 3 - ...ate-prkeys-file-on-changing-registra.patch | 3 - ...n-about-missing-braces-at-end-of-mul.patch | 3 - ...ore-multipaths-sections-without-wwid.patch | 3 - ...tipath-fix-format-warning-with-clang.patch | 3 - ...th-check-for-null-wwid-before-strcmp.patch | 3 - ...-Improve-checker_timeout-description.patch | 3 - ...ath-checkint-not-changed-when-path-s.patch | 3 - ...ect_action-skip-is_mpp_known_to_udev.patch | 3 - ...lesce_paths-stop-triggering-spurious.patch | 3 - ...d-uev_trigger-handle-incomplete-ADD-.patch | 3 - ...ath-make-find_err_path_by_dev-static.patch | 3 - ...id-io_err_stat-crash-during-shutdown.patch | 3 - ...athd-avoid-io_err_stat-ABBA-deadlock.patch | 3 - ...et_monotonic_time-in-io_err_stat-cod.patch | 3 - ...ne-free_io_err_stat_path-and-destroy.patch | 3 - ...d-cleanup-logging-for-marginal-paths.patch | 3 - ...-NULL-dereference-in-find_path_by_de.patch | 3 - ...print_devices-avoid-NULL-dereference.patch | 3 - ...fix-thread-safety-of-default-functio.patch | 3 - 0106-Added-github-action-for-building.patch | 3 - ...use-zram-device-as-test-block-device.patch | 3 - ...workflow-use-explicit-Ubuntu-version.patch | 3 - 0109-github-workflow-add-valgrind-tests.patch | 3 - 0110-github-workflow-run-apt-get-update.patch | 3 - ...flow-add-tests-with-gcc-10-and-clang.patch | 3 - ...-Fix-multipathd-stopping-on-shutdown.patch | 3 - ...-3rd-digit-as-transport_id-for-expan.patch | 3 - ...fs_set_nexus_loss_tmo-support-SAS-ex.patch | 3 - ...pathd-add-code-to-initalize-unwinder.patch | 3 - ...ck-if-adopt_path-really-added-curren.patch | 3 - ...d_path-fail-if-add_map_with_path-fai.patch | 3 - ...ck-return-value-of-udev_device_get_d.patch | 3 - ...filter_property-after-sysfs_pathinfo.patch | 3 - ...hinfo-call-filter_property-only-with.patch | 3 - ...h-w-allow-removing-blacklisted-paths.patch | 3 - ...h-fix-use-after-free-in-uev_add_path.patch | 6 +- ...tests-fix-stringop-overflow-build-er.patch | 52 ++ ...anup-code-to-strip-wwid-trailing-spa.patch | 44 ++ ...-cleanup-uid_attribute-checking-code.patch | 53 ++ ...echeck_wwid-option-to-verify-the-pat.patch | 453 +++++++++++++++ ...heck-if-user_friendly_name-is-in-use.patch | 231 ++++++++ ...ests-for-checking-if-alias-is-in-use.patch | 525 ++++++++++++++++++ ...add-DellEMC-PowerStore-to-hardware-t.patch | 40 ++ ...delete-a-space-in-multipath.conf.5-t.patch | 30 + ...tests-allow-control-of-test-verbosit.patch | 253 +++++++++ ...devt-test-avoid-failure-when-run-in-.patch | 63 +++ ...fix-compilation-errors-on-32-bit-mus.patch | 96 ++++ ...-compilation-error-with-gcc-10-on-i3.patch | 58 ++ ...loop-device-after-listing-partitions.patch | 6 +- ...ge-update_multipath_table-and-update.patch | 229 ++++++++ ...-mpath.rules-run-multipath-U-with-v1.patch | 41 ++ ...tests-check-if-sys-dev-block-is-non-.patch | 62 +++ ...thd-reduce-log-levels-in-cli_add_map.patch | 36 ++ ...fix-format-in-multipath.conf.5-to-be.patch | 30 + ...use-same-format-for-default-values-i.patch | 41 ++ ...d-fix-NULL-dereference-in-check_path.patch | 39 ++ ...id-infinite-loop-with-bad-vpd-page-8.patch | 28 + ...ath-fix-priorities-in-parse_vpd_pg83.patch | 46 ++ ...ve-getting-parent-udevice-in-rescan_.patch | 40 ++ ...-trigger-uevent-for-partitions-on-ww.patch | 26 + ... 0147-RH-fixup-udev-rules-for-redhat.patch | 3 - ...property-blacklist-exception-builtin.patch | 11 +- ...RH-don-t-start-without-a-config-file.patch | 9 +- ...H-Fix-nvme-function-missing-argument.patch | 3 - ... 0151-RH-use-rpm-optflags-if-present.patch | 3 - ...hconf.patch => 0152-RH-add-mpathconf.patch | 7 +- ...om-kernel-cmdline-mpath.wwids-with-A.patch | 11 +- ...-default-find_mutipaths-value-to-off.patch | 5 +- ...empt-to-get-ANA-info-via-sysfs-first.patch | 3 - ...-parse_vpd_pg83-match-scsi_id-output.patch | 51 ++ device-mapper-multipath.spec | 59 +- 157 files changed, 2633 insertions(+), 423 deletions(-) create mode 100644 0123-multipath-tools-tests-fix-stringop-overflow-build-er.patch create mode 100644 0124-libmultipath-cleanup-code-to-strip-wwid-trailing-spa.patch create mode 100644 0125-libmultipath-cleanup-uid_attribute-checking-code.patch create mode 100644 0126-multipathd-add-recheck_wwid-option-to-verify-the-pat.patch create mode 100644 0127-libmultipath-check-if-user_friendly_name-is-in-use.patch create mode 100644 0128-tests-add-tests-for-checking-if-alias-is-in-use.patch create mode 100644 0129-multipath-tools-add-DellEMC-PowerStore-to-hardware-t.patch create mode 100644 0130-multipath-tools-delete-a-space-in-multipath.conf.5-t.patch create mode 100644 0131-multipath-tools-tests-allow-control-of-test-verbosit.patch create mode 100644 0132-multipath-tools-devt-test-avoid-failure-when-run-in-.patch create mode 100644 0133-multipath-tools-fix-compilation-errors-on-32-bit-mus.patch create mode 100644 0134-libmultipath-fix-compilation-error-with-gcc-10-on-i3.patch rename 0123-kpartx-free-loop-device-after-listing-partitions.patch => 0135-kpartx-free-loop-device-after-listing-partitions.patch (95%) create mode 100644 0136-libmultipath-merge-update_multipath_table-and-update.patch create mode 100644 0137-11-dm-mpath.rules-run-multipath-U-with-v1.patch create mode 100644 0138-multipath-tools-tests-check-if-sys-dev-block-is-non-.patch create mode 100644 0139-multipathd-reduce-log-levels-in-cli_add_map.patch create mode 100644 0140-multipath-tools-fix-format-in-multipath.conf.5-to-be.patch create mode 100644 0141-multipath-tools-use-same-format-for-default-values-i.patch create mode 100644 0142-multipathd-fix-NULL-dereference-in-check_path.patch create mode 100644 0143-libmultipath-avoid-infinite-loop-with-bad-vpd-page-8.patch create mode 100644 0144-libmultipath-fix-priorities-in-parse_vpd_pg83.patch create mode 100644 0145-multipathd-improve-getting-parent-udevice-in-rescan_.patch create mode 100644 0146-multipathd-don-t-trigger-uevent-for-partitions-on-ww.patch rename 0124-RH-fixup-udev-rules-for-redhat.patch => 0147-RH-fixup-udev-rules-for-redhat.patch (99%) rename 0125-RH-Remove-the-property-blacklist-exception-builtin.patch => 0148-RH-Remove-the-property-blacklist-exception-builtin.patch (95%) rename 0126-RH-don-t-start-without-a-config-file.patch => 0149-RH-don-t-start-without-a-config-file.patch (96%) rename 0127-RH-Fix-nvme-function-missing-argument.patch => 0150-RH-Fix-nvme-function-missing-argument.patch (98%) rename 0128-RH-use-rpm-optflags-if-present.patch => 0151-RH-use-rpm-optflags-if-present.patch (99%) rename 0129-RH-add-mpathconf.patch => 0152-RH-add-mpathconf.patch (99%) rename 0130-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch => 0153-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch (96%) rename 0131-RH-reset-default-find_mutipaths-value-to-off.patch => 0154-RH-reset-default-find_mutipaths-value-to-off.patch (95%) rename 0132-RH-attempt-to-get-ANA-info-via-sysfs-first.patch => 0155-RH-attempt-to-get-ANA-info-via-sysfs-first.patch (99%) create mode 100644 0156-RH-make-parse_vpd_pg83-match-scsi_id-output.patch diff --git a/0001-Change-the-multipath.conf-manpage-uxsock_timeout-def.patch b/0001-Change-the-multipath.conf-manpage-uxsock_timeout-def.patch index 02b2e18..21428df 100644 --- a/0001-Change-the-multipath.conf-manpage-uxsock_timeout-def.patch +++ b/0001-Change-the-multipath.conf-manpage-uxsock_timeout-def.patch @@ -25,6 +25,3 @@ index d2101ed6..7242d39b 100644 .RE . . --- -2.17.2 - diff --git a/0002-libmultipath-find_mpe-don-t-match-with-empty-WWID.patch b/0002-libmultipath-find_mpe-don-t-match-with-empty-WWID.patch index 2d38590..6ceeac1 100644 --- a/0002-libmultipath-find_mpe-don-t-match-with-empty-WWID.patch +++ b/0002-libmultipath-find_mpe-don-t-match-with-empty-WWID.patch @@ -22,6 +22,3 @@ index b9bdbdbc..df0f8f45 100644 return NULL; vector_foreach_slot (mptable, mpe, i) --- -2.17.2 - diff --git a/0003-libmultipath-copy-mpp-hwe-from-pp-hwe.patch b/0003-libmultipath-copy-mpp-hwe-from-pp-hwe.patch index 63ff6a5..fa4da39 100644 --- a/0003-libmultipath-copy-mpp-hwe-from-pp-hwe.patch +++ b/0003-libmultipath-copy-mpp-hwe-from-pp-hwe.patch @@ -255,6 +255,3 @@ index a4abbb27..eedc6c10 100644 if (setup_map(mpp, params, PARAMS_SIZE, vecs)) { condlog(0, "%s: failed to setup map for" " removal of path %s", mpp->alias, pp->dev); --- -2.17.2 - diff --git a/0004-libmultipath-dm_map_present_by_uuid-fix-dm_task_crea.patch b/0004-libmultipath-dm_map_present_by_uuid-fix-dm_task_crea.patch index c3a0a18..f4177ec 100644 --- a/0004-libmultipath-dm_map_present_by_uuid-fix-dm_task_crea.patch +++ b/0004-libmultipath-dm_map_present_by_uuid-fix-dm_task_crea.patch @@ -26,6 +26,3 @@ index 7f093617..0bc1d16e 100644 goto out; dm_task_no_open_count(dmt); --- -2.17.2 - diff --git a/0005-libdmmp-tests-fix-compilation.patch b/0005-libdmmp-tests-fix-compilation.patch index d1d9955..ae341cf 100644 --- a/0005-libdmmp-tests-fix-compilation.patch +++ b/0005-libdmmp-tests-fix-compilation.patch @@ -38,6 +38,3 @@ index d944e1e3..a940b576 100644 { struct dmmp_context *ctx = NULL; struct dmmp_mpath **dmmp_mps = NULL; --- -2.17.2 - diff --git a/0006-libmultipath-prio-constify-some-function-parameters.patch b/0006-libmultipath-prio-constify-some-function-parameters.patch index 80771ea..94fbd17 100644 --- a/0006-libmultipath-prio-constify-some-function-parameters.patch +++ b/0006-libmultipath-prio-constify-some-function-parameters.patch @@ -48,6 +48,3 @@ index 599d1d88..26754f78 100644 int prio_getprio (struct prio *, struct path *, unsigned int); void prio_get (char *, struct prio *, char *, char *); void prio_put (struct prio *); --- -2.17.2 - diff --git a/0007-libmultipath-checkers-prio-allow-non-lazy-.so-loadin.patch b/0007-libmultipath-checkers-prio-allow-non-lazy-.so-loadin.patch index 90a2f25..bdea162 100644 --- a/0007-libmultipath-checkers-prio-allow-non-lazy-.so-loadin.patch +++ b/0007-libmultipath-checkers-prio-allow-non-lazy-.so-loadin.patch @@ -85,6 +85,3 @@ index 3a718ba5..c92bde7f 100644 return 0; } --- -2.17.2 - diff --git a/0008-multipath-tools-Makefiles-separate-rules-for-.so-and.patch b/0008-multipath-tools-Makefiles-separate-rules-for-.so-and.patch index edc3e66..81ee846 100644 --- a/0008-multipath-tools-Makefiles-separate-rules-for-.so-and.patch +++ b/0008-multipath-tools-Makefiles-separate-rules-for-.so-and.patch @@ -91,6 +91,3 @@ index 62ba16e8..40028556 100644 $(INSTALL_PROGRAM) -d $(DESTDIR)$(syslibdir) $(INSTALL_PROGRAM) -m 755 $(LIBS) $(DESTDIR)$(syslibdir)/$(LIBS) $(INSTALL_PROGRAM) -m 755 -d $(DESTDIR)$(libdir) --- -2.17.2 - diff --git a/0009-libmultipath-create-separate-.so-for-unit-tests.patch b/0009-libmultipath-create-separate-.so-for-unit-tests.patch index 38a01d7..a342425 100644 --- a/0009-libmultipath-create-separate-.so-for-unit-tests.patch +++ b/0009-libmultipath-create-separate-.so-for-unit-tests.patch @@ -82,6 +82,3 @@ index d26b3ce7..9658c9fd 100644 $(CC) $(CFLAGS) -o $@ $(LDFLAGS) $< $($@_TESTDEPS) $($@_OBJDEPS) \ $(LIBDEPS) $($@_LIBDEPS) \ $(shell cat $<.wrap) $(foreach dep,$($@_TESTDEPS),$(shell cat $(dep).wrap)) --- -2.17.2 - diff --git a/0010-libmultipath-add-linker-version-script.patch b/0010-libmultipath-add-linker-version-script.patch index ed6ad7f..afbb4f3 100644 --- a/0010-libmultipath-add-linker-version-script.patch +++ b/0010-libmultipath-add-linker-version-script.patch @@ -298,6 +298,3 @@ index 00000000..a6bf8218 +local: + *; +}; --- -2.17.2 - diff --git a/0011-libmpathpersist-add-linker-version-script.patch b/0011-libmpathpersist-add-linker-version-script.patch index 916c4f3..e43e068 100644 --- a/0011-libmpathpersist-add-linker-version-script.patch +++ b/0011-libmpathpersist-add-linker-version-script.patch @@ -76,6 +76,3 @@ index 00000000..dc648ce6 + +local: *; +}; --- -2.17.2 - diff --git a/0012-libmpathcmd-add-linker-version-script.patch b/0012-libmpathcmd-add-linker-version-script.patch index 454c3b7..15ab67b 100644 --- a/0012-libmpathcmd-add-linker-version-script.patch +++ b/0012-libmpathcmd-add-linker-version-script.patch @@ -69,6 +69,3 @@ index 00000000..f1006280 +local: + *; +}; --- -2.17.2 - diff --git a/0013-libmpathpersist-initialize-mpp-hwe-in-get_mpvec.patch b/0013-libmpathpersist-initialize-mpp-hwe-in-get_mpvec.patch index a04673d..73d5f55 100644 --- a/0013-libmpathpersist-initialize-mpp-hwe-in-get_mpvec.patch +++ b/0013-libmpathpersist-initialize-mpp-hwe-in-get_mpvec.patch @@ -33,6 +33,3 @@ index 1f9817ed..4b3f3e0d 100644 } return MPATH_PR_SUCCESS ; } --- -2.17.2 - diff --git a/0014-multipathd-allow-shutdown-during-configure.patch b/0014-multipathd-allow-shutdown-during-configure.patch index 2cbfecf..951cf53 100644 --- a/0014-multipathd-allow-shutdown-during-configure.patch +++ b/0014-multipathd-allow-shutdown-during-configure.patch @@ -135,6 +135,3 @@ index eedc6c10..fa53e963 100644 sync_maps_state(mpvec); vector_foreach_slot(mpvec, mpp, i){ if (remember_wwid(mpp->wwid) == 1) --- -2.17.2 - diff --git a/0015-multipathd-avoid-sending-READY-1-to-systemd-on-early.patch b/0015-multipathd-avoid-sending-READY-1-to-systemd-on-early.patch index c2d1475..d6a674b 100644 --- a/0015-multipathd-avoid-sending-READY-1-to-systemd-on-early.patch +++ b/0015-multipathd-avoid-sending-READY-1-to-systemd-on-early.patch @@ -62,6 +62,3 @@ index fa53e963..53a22a43 100644 } } --- -2.17.2 - diff --git a/0016-multipathd-send-STOPPING-1-to-systemd-on-shutdown.patch b/0016-multipathd-send-STOPPING-1-to-systemd-on-shutdown.patch index b38cf2f..fbcfc2d 100644 --- a/0016-multipathd-send-STOPPING-1-to-systemd-on-shutdown.patch +++ b/0016-multipathd-send-STOPPING-1-to-systemd-on-shutdown.patch @@ -26,6 +26,3 @@ index 53a22a43..c264351c 100644 sd_notify(0, "READY=1"); startup_done = true; } --- -2.17.2 - diff --git a/0017-multipathd-send-RELOADING-1-to-systemd-on-DAEMON_CON.patch b/0017-multipathd-send-RELOADING-1-to-systemd-on-DAEMON_CON.patch index 76894d0..8b2d70e 100644 --- a/0017-multipathd-send-RELOADING-1-to-systemd-on-DAEMON_CON.patch +++ b/0017-multipathd-send-RELOADING-1-to-systemd-on-DAEMON_CON.patch @@ -37,6 +37,3 @@ index c264351c..e3f2328d 100644 } #endif --- -2.17.2 - diff --git a/0018-multipathd-use-volatile-qualifier-for-running_state.patch b/0018-multipathd-use-volatile-qualifier-for-running_state.patch index 400298e..7d9e6d2 100644 --- a/0018-multipathd-use-volatile-qualifier-for-running_state.patch +++ b/0018-multipathd-use-volatile-qualifier-for-running_state.patch @@ -26,6 +26,3 @@ index e3f2328d..d081b3e9 100644 pid_t daemon_pid; pthread_mutex_t config_lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t config_cond; --- -2.17.2 - diff --git a/0019-multipathd-generalize-and-fix-wait_for_state_change_.patch b/0019-multipathd-generalize-and-fix-wait_for_state_change_.patch index 73f99ec..a08eacd 100644 --- a/0019-multipathd-generalize-and-fix-wait_for_state_change_.patch +++ b/0019-multipathd-generalize-and-fix-wait_for_state_change_.patch @@ -67,6 +67,3 @@ index d081b3e9..1fb0ee62 100644 pthread_cleanup_pop(1); return st; } --- -2.17.2 - diff --git a/0020-multipathd-set_config_state-avoid-code-duplication.patch b/0020-multipathd-set_config_state-avoid-code-duplication.patch index a5310f3..e4dbd04 100644 --- a/0020-multipathd-set_config_state-avoid-code-duplication.patch +++ b/0020-multipathd-set_config_state-avoid-code-duplication.patch @@ -50,6 +50,3 @@ index 1fb0ee62..39aea4ad 100644 } pthread_cleanup_pop(1); return rc; --- -2.17.2 - diff --git a/0021-multipathd-cancel-threads-early-during-shutdown.patch b/0021-multipathd-cancel-threads-early-during-shutdown.patch index cc51513..96f9b75 100644 --- a/0021-multipathd-cancel-threads-early-during-shutdown.patch +++ b/0021-multipathd-cancel-threads-early-during-shutdown.patch @@ -56,6 +56,3 @@ index 39aea4ad..d1f8cc1b 100644 pthread_join(check_thr, NULL); pthread_join(uevent_thr, NULL); pthread_join(uxlsnr_thr, NULL); --- -2.17.2 - diff --git a/0022-multipath-tools-don-t-call-dm_lib_release-any-more.patch b/0022-multipath-tools-don-t-call-dm_lib_release-any-more.patch index fe32b1a..447c884 100644 --- a/0022-multipath-tools-don-t-call-dm_lib_release-any-more.patch +++ b/0022-multipath-tools-don-t-call-dm_lib_release-any-more.patch @@ -160,6 +160,3 @@ index d1f8cc1b..5cc34357 100644 dm_lib_exit(); /* We're done here */ --- -2.17.2 - diff --git a/0023-libmultipath-devmapper-refactor-libdm-version-determ.patch b/0023-libmultipath-devmapper-refactor-libdm-version-determ.patch index b5e96b2..76a14eb 100644 --- a/0023-libmultipath-devmapper-refactor-libdm-version-determ.patch +++ b/0023-libmultipath-devmapper-refactor-libdm-version-determ.patch @@ -501,6 +501,3 @@ index b7c09cc2..e7663f9a 100644 select_minio(conf, mp); put_multipath_config(conf); --- -2.17.2 - diff --git a/0024-libmultipath-protect-racy-libdevmapper-calls-with-a-.patch b/0024-libmultipath-protect-racy-libdevmapper-calls-with-a-.patch index 026dd7c..f8dd1e3 100644 --- a/0024-libmultipath-protect-racy-libdevmapper-calls-with-a-.patch +++ b/0024-libmultipath-protect-racy-libdevmapper-calls-with-a-.patch @@ -432,6 +432,3 @@ index bee117ac..b7c5122b 100644 assert_ptr_equal((struct test_data *)dmt, &data); if (data.names) { --- -2.17.2 - diff --git a/0025-libmultipath-constify-file-argument-in-config-parser.patch b/0025-libmultipath-constify-file-argument-in-config-parser.patch index 9470cf4..4344b92 100644 --- a/0025-libmultipath-constify-file-argument-in-config-parser.patch +++ b/0025-libmultipath-constify-file-argument-in-config-parser.patch @@ -93,6 +93,3 @@ index 62906e98..06666ccf 100644 extern struct keyword * find_keyword(vector keywords, vector v, char * name); int snprint_keyword(char *buff, int len, char *fmt, struct keyword *kw, const void *data); --- -2.17.2 - diff --git a/0026-libmultipath-provide-defaults-for-get-put-_multipath.patch b/0026-libmultipath-provide-defaults-for-get-put-_multipath.patch index e3375f0..9a0af2a 100644 --- a/0026-libmultipath-provide-defaults-for-get-put-_multipath.patch +++ b/0026-libmultipath-provide-defaults-for-get-put-_multipath.patch @@ -199,6 +199,3 @@ index 97acdbb2..3e780fce 100644 + init_config; + uninit_config; +} LIBMULTIPATH_2.1.0; --- -2.17.2 - diff --git a/0027-libmpathpersist-allow-using-libmultipath-get-put-_mu.patch b/0027-libmpathpersist-allow-using-libmultipath-get-put-_mu.patch index def8896..13e8b10 100644 --- a/0027-libmpathpersist-allow-using-libmultipath-get-put-_mu.patch +++ b/0027-libmpathpersist-allow-using-libmultipath-get-put-_mu.patch @@ -151,6 +151,3 @@ index 7cf4faf9..91606efc 100644 /* * DESCRIPTION : --- -2.17.2 - diff --git a/0028-multipath-use-get_put-_multipath_config-from-libmult.patch b/0028-multipath-use-get_put-_multipath_config-from-libmult.patch index 762daea..6ccc2ea 100644 --- a/0028-multipath-use-get_put-_multipath_config-from-libmult.patch +++ b/0028-multipath-use-get_put-_multipath_config-from-libmult.patch @@ -62,6 +62,3 @@ index dc4974b9..4bbfce9a 100644 udev_unref(udev); if (dev) FREE(dev); --- -2.17.2 - diff --git a/0029-mpathpersist-use-get-put-_multipath_config-from-libm.patch b/0029-mpathpersist-use-get-put-_multipath_config-from-libm.patch index 6ab3c10..09c4ad8 100644 --- a/0029-mpathpersist-use-get-put-_multipath_config-from-libm.patch +++ b/0029-mpathpersist-use-get-put-_multipath_config-from-libm.patch @@ -50,6 +50,3 @@ index a6a3bcf6..278e48f7 100644 udev_unref(udev); return (ret >= 0) ? ret : MPATH_PR_OTHER; --- -2.17.2 - diff --git a/0030-libmultipath-add-udev-and-logsink-symbols.patch b/0030-libmultipath-add-udev-and-logsink-symbols.patch index 3bd9de0..d936a42 100644 --- a/0030-libmultipath-add-udev-and-logsink-symbols.patch +++ b/0030-libmultipath-add-udev-and-logsink-symbols.patch @@ -163,6 +163,3 @@ index 3e780fce..0c300c81 100644 + libmultipath_init; + libmultipath_exit; +} LIBMULTIPATH_2.2.0; --- -2.17.2 - diff --git a/0031-multipath-remove-logsink-and-udev.patch b/0031-multipath-remove-logsink-and-udev.patch index 7ba8272..4faf540 100644 --- a/0031-multipath-remove-logsink-and-udev.patch +++ b/0031-multipath-remove-logsink-and-udev.patch @@ -43,6 +43,3 @@ index 4bbfce9a..9ae46ed5 100644 if (dev) FREE(dev); #ifdef _DEBUG_ --- -2.17.2 - diff --git a/0032-libmpathpersist-call-libmultipath_-init-exit.patch b/0032-libmpathpersist-call-libmultipath_-init-exit.patch index 9c52f9f..9671dfd 100644 --- a/0032-libmpathpersist-call-libmultipath_-init-exit.patch +++ b/0032-libmpathpersist-call-libmultipath_-init-exit.patch @@ -91,6 +91,3 @@ index 91606efc..5435eae4 100644 * RESTRICTIONS: * * RETURNS: 0->Success, 1->Failed. --- -2.17.2 - diff --git a/0033-mpathpersist-remove-logsink-and-udev.patch b/0033-mpathpersist-remove-logsink-and-udev.patch index 501f32f..bf508c6 100644 --- a/0033-mpathpersist-remove-logsink-and-udev.patch +++ b/0033-mpathpersist-remove-logsink-and-udev.patch @@ -47,6 +47,3 @@ index 278e48f7..3c2e6576 100644 return (ret >= 0) ? ret : MPATH_PR_OTHER; } --- -2.17.2 - diff --git a/0034-multipathd-remove-logsink-and-udev.patch b/0034-multipathd-remove-logsink-and-udev.patch index 25e929a..f974fd5 100644 --- a/0034-multipathd-remove-logsink-and-udev.patch +++ b/0034-multipathd-remove-logsink-and-udev.patch @@ -52,6 +52,3 @@ index 00b66ba4..c5c374b7 100644 libmp_udev_set_sync_support(0); while ((arg = getopt(argc, argv, ":dsv:k::Bniw")) != EOF ) { --- -2.17.2 - diff --git a/0035-multipath-tools-add-Vexata-by-StorCentric-VX-arrays.patch b/0035-multipath-tools-add-Vexata-by-StorCentric-VX-arrays.patch index c8fa5bb..3c50b70 100644 --- a/0035-multipath-tools-add-Vexata-by-StorCentric-VX-arrays.patch +++ b/0035-multipath-tools-add-Vexata-by-StorCentric-VX-arrays.patch @@ -35,6 +35,3 @@ index cd65afcc..c1d6f7ae 100644 }, /* * Promise Technology --- -2.17.2 - diff --git a/0036-multipath-tools-Violin-and-Nexsan-were-bought-by-Sto.patch b/0036-multipath-tools-Violin-and-Nexsan-were-bought-by-Sto.patch index 006d74e..1ba6166 100644 --- a/0036-multipath-tools-Violin-and-Nexsan-were-bought-by-Sto.patch +++ b/0036-multipath-tools-Violin-and-Nexsan-were-bought-by-Sto.patch @@ -40,6 +40,3 @@ index c1d6f7ae..a54cc0a3 100644 { /* 3000 / 6000 Series */ .vendor = "VIOLIN", --- -2.17.2 - diff --git a/0037-libmultipath-fix-memory-leaks-in-coalesce_paths.patch b/0037-libmultipath-fix-memory-leaks-in-coalesce_paths.patch index 0f67ead..a40bf11 100644 --- a/0037-libmultipath-fix-memory-leaks-in-coalesce_paths.patch +++ b/0037-libmultipath-fix-memory-leaks-in-coalesce_paths.patch @@ -112,6 +112,3 @@ index 1c8aac08..d36f0d0d 100644 return ret; } --- -2.17.2 - diff --git a/0038-multipath-tools-replace-hidden-tab-by-space-in-hwtab.patch b/0038-multipath-tools-replace-hidden-tab-by-space-in-hwtab.patch index d51c502..f75dd91 100644 --- a/0038-multipath-tools-replace-hidden-tab-by-space-in-hwtab.patch +++ b/0038-multipath-tools-replace-hidden-tab-by-space-in-hwtab.patch @@ -26,6 +26,3 @@ index a54cc0a3..921aadc5 100644 .product = "^NetApp ONTAP Controller", .pgpolicy = MULTIBUS, .no_path_retry = NO_PATH_RETRY_QUEUE, --- -2.17.2 - diff --git a/0039-multipathd-uxlsnr-avoid-deadlock-on-exit.patch b/0039-multipathd-uxlsnr-avoid-deadlock-on-exit.patch index 6f4fc00..db589ac 100644 --- a/0039-multipathd-uxlsnr-avoid-deadlock-on-exit.patch +++ b/0039-multipathd-uxlsnr-avoid-deadlock-on-exit.patch @@ -100,6 +100,3 @@ index 1c5ce9d2..ce2b6800 100644 if (polls[i].revents & POLLIN) { struct timespec start_time; --- -2.17.2 - diff --git a/0040-multipathd-Fix-liburcu-memory-leak.patch b/0040-multipathd-Fix-liburcu-memory-leak.patch index 8f04a66..0416db3 100644 --- a/0040-multipathd-Fix-liburcu-memory-leak.patch +++ b/0040-multipathd-Fix-liburcu-memory-leak.patch @@ -93,6 +93,3 @@ index c5c374b7..ce14bb66 100644 setup_thread_attr(&misc_attr, 64 * 1024, 0); setup_thread_attr(&uevent_attr, DEFAULT_UEVENT_STACKSIZE * 1024, 0); --- -2.17.2 - diff --git a/0041-multipathd-move-handling-of-io_err_stat_attr-into-li.patch b/0041-multipathd-move-handling-of-io_err_stat_attr-into-li.patch index 329876d..8a0e23d 100644 --- a/0041-multipathd-move-handling-of-io_err_stat_attr-into-li.patch +++ b/0041-multipathd-move-handling-of-io_err_stat_attr-into-li.patch @@ -141,6 +141,3 @@ index ce14bb66..abc6a9f7 100644 #ifdef _DEBUG_ dbg_free_final(NULL); #endif --- -2.17.2 - diff --git a/0042-multipathd-move-vecs-desctruction-into-cleanup-funct.patch b/0042-multipathd-move-vecs-desctruction-into-cleanup-funct.patch index f65e6eb..1c0c3fd 100644 --- a/0042-multipathd-move-vecs-desctruction-into-cleanup-funct.patch +++ b/0042-multipathd-move-vecs-desctruction-into-cleanup-funct.patch @@ -120,6 +120,3 @@ index abc6a9f7..3da0d7cc 100644 cleanup_foreign(); cleanup_checkers(); cleanup_prio(); --- -2.17.2 - diff --git a/0043-multipathd-make-some-globals-static.patch b/0043-multipathd-make-some-globals-static.patch index 6ae5835..c7fb5ce 100644 --- a/0043-multipathd-make-some-globals-static.patch +++ b/0043-multipathd-make-some-globals-static.patch @@ -40,6 +40,3 @@ index 3da0d7cc..eb760a71 100644 static inline enum daemon_status get_running_state(void) { --- -2.17.2 - diff --git a/0044-multipathd-move-threads-destruction-into-separate-fu.patch b/0044-multipathd-move-threads-destruction-into-separate-fu.patch index 6c2251e..2e069ff 100644 --- a/0044-multipathd-move-threads-destruction-into-separate-fu.patch +++ b/0044-multipathd-move-threads-destruction-into-separate-fu.patch @@ -159,6 +159,3 @@ index eb760a71..9eb658d4 100644 #ifdef _DEBUG_ dbg_free_final(NULL); #endif --- -2.17.2 - diff --git a/0045-multipathd-move-conf-destruction-into-separate-funct.patch b/0045-multipathd-move-conf-destruction-into-separate-funct.patch index 97125dc..c6ea6b2 100644 --- a/0045-multipathd-move-conf-destruction-into-separate-funct.patch +++ b/0045-multipathd-move-conf-destruction-into-separate-funct.patch @@ -51,6 +51,3 @@ index 9eb658d4..07973e85 100644 #ifdef _DEBUG_ dbg_free_final(NULL); #endif --- -2.17.2 - diff --git a/0046-multipathd-move-pid-destruction-into-separate-functi.patch b/0046-multipathd-move-pid-destruction-into-separate-functi.patch index bbff859..70220dd 100644 --- a/0046-multipathd-move-pid-destruction-into-separate-functi.patch +++ b/0046-multipathd-move-pid-destruction-into-separate-functi.patch @@ -37,6 +37,3 @@ index 07973e85..fc1f8d7f 100644 condlog(2, "--------shut down-------"); if (logsink == 1) --- -2.17.2 - diff --git a/0047-multipathd-close-pidfile-on-exit.patch b/0047-multipathd-close-pidfile-on-exit.patch index 6c9c1b1..fa3a5e9 100644 --- a/0047-multipathd-close-pidfile-on-exit.patch +++ b/0047-multipathd-close-pidfile-on-exit.patch @@ -40,6 +40,3 @@ index fc1f8d7f..f6b80668 100644 struct config *conf; char *envp; enum daemon_status state; --- -2.17.2 - diff --git a/0048-multipathd-add-helper-for-systemd-notification-at-ex.patch b/0048-multipathd-add-helper-for-systemd-notification-at-ex.patch index bf3c462..8dfe28e 100644 --- a/0048-multipathd-add-helper-for-systemd-notification-at-ex.patch +++ b/0048-multipathd-add-helper-for-systemd-notification-at-ex.patch @@ -55,6 +55,3 @@ index f6b80668..07068e4a 100644 } static int --- -2.17.2 - diff --git a/0049-multipathd-child-call-cleanups-in-failure-case-too.patch b/0049-multipathd-child-call-cleanups-in-failure-case-too.patch index fba8169..85bd5f4 100644 --- a/0049-multipathd-child-call-cleanups-in-failure-case-too.patch +++ b/0049-multipathd-child-call-cleanups-in-failure-case-too.patch @@ -47,6 +47,3 @@ index 07068e4a..6b9e323e 100644 } static int --- -2.17.2 - diff --git a/0050-multipathd-unwatch_all_dmevents-check-if-waiter-is-i.patch b/0050-multipathd-unwatch_all_dmevents-check-if-waiter-is-i.patch index 279109c..2629bab 100644 --- a/0050-multipathd-unwatch_all_dmevents-check-if-waiter-is-i.patch +++ b/0050-multipathd-unwatch_all_dmevents-check-if-waiter-is-i.patch @@ -23,6 +23,3 @@ index b561cbfd..f52f5970 100644 pthread_mutex_lock(&waiter->events_lock); vector_foreach_slot(waiter->events, dev_evt, i) free(dev_evt); --- -2.17.2 - diff --git a/0051-multipathd-print-error-message-if-config-can-t-be-lo.patch b/0051-multipathd-print-error-message-if-config-can-t-be-lo.patch index 9cf6182..0d51d12 100644 --- a/0051-multipathd-print-error-message-if-config-can-t-be-lo.patch +++ b/0051-multipathd-print-error-message-if-config-can-t-be-lo.patch @@ -25,6 +25,3 @@ index 6b9e323e..7ab3eab8 100644 if (verbosity) conf->verbosity = verbosity; --- -2.17.2 - diff --git a/0052-libmultipath-add-libmp_dm_exit.patch b/0052-libmultipath-add-libmp_dm_exit.patch index db24711..86baccd 100644 --- a/0052-libmultipath-add-libmp_dm_exit.patch +++ b/0052-libmultipath-add-libmp_dm_exit.patch @@ -87,6 +87,3 @@ index fa6b3c53..e29b4d41 100644 void libmp_udev_set_sync_support(int on); struct dm_task *libmp_dm_task_create(int task); int dm_simplecmd_flush (int, const char *, uint16_t); --- -2.17.2 - diff --git a/0053-multipathd-fixup-libdm-deinitialization.patch b/0053-multipathd-fixup-libdm-deinitialization.patch index b57a8cd..b12d925 100644 --- a/0053-multipathd-fixup-libdm-deinitialization.patch +++ b/0053-multipathd-fixup-libdm-deinitialization.patch @@ -35,6 +35,3 @@ index 7ab3eab8..4c4e2eab 100644 libmultipath_init(); if (atexit(libmultipath_exit)) condlog(3, "failed to register exit handler for libmultipath"); --- -2.17.2 - diff --git a/0054-libmultipath-log_thread_stop-check-if-logarea-is-ini.patch b/0054-libmultipath-log_thread_stop-check-if-logarea-is-ini.patch index 004016c..32a6fc8 100644 --- a/0054-libmultipath-log_thread_stop-check-if-logarea-is-ini.patch +++ b/0054-libmultipath-log_thread_stop-check-if-logarea-is-ini.patch @@ -24,6 +24,3 @@ index 15baef88..0c327ffc 100644 logdbg(stderr,"enter log_thread_stop\n"); pthread_mutex_lock(&logev_lock); --- -2.17.2 - diff --git a/0055-multipathd-add-cleanup_child-exit-handler.patch b/0055-multipathd-add-cleanup_child-exit-handler.patch index 8455a96..a031baa 100644 --- a/0055-multipathd-add-cleanup_child-exit-handler.patch +++ b/0055-multipathd-add-cleanup_child-exit-handler.patch @@ -90,6 +90,3 @@ index 4c4e2eab..50cc3356 100644 return sd_notify_exit(exit_code); } --- -2.17.2 - diff --git a/0056-libmultipath-fix-log_thread-startup-and-teardown.patch b/0056-libmultipath-fix-log_thread-startup-and-teardown.patch index 106f19a..0804551 100644 --- a/0056-libmultipath-fix-log_thread-startup-and-teardown.patch +++ b/0056-libmultipath-fix-log_thread-startup-and-teardown.patch @@ -143,6 +143,3 @@ index 0c327ffc..3a2566ae 100644 pthread_mutex_destroy(&logq_lock); pthread_mutex_destroy(&logev_lock); --- -2.17.2 - diff --git a/0057-multipathd-move-cleanup_-prio-checkers-foreign-to-li.patch b/0057-multipathd-move-cleanup_-prio-checkers-foreign-to-li.patch index 017034e..891b54f 100644 --- a/0057-multipathd-move-cleanup_-prio-checkers-foreign-to-li.patch +++ b/0057-multipathd-move-cleanup_-prio-checkers-foreign-to-li.patch @@ -88,6 +88,3 @@ index 50cc3356..4de0978e 100644 if (poll_dmevents) cleanup_dmevent_waiter(); --- -2.17.2 - diff --git a/0058-multipath-use-atexit-for-cleanup-handlers.patch b/0058-multipath-use-atexit-for-cleanup-handlers.patch index 444a39d..b07cf95 100644 --- a/0058-multipath-use-atexit-for-cleanup-handlers.patch +++ b/0058-multipath-use-atexit-for-cleanup-handlers.patch @@ -105,6 +105,3 @@ index 9ae46ed5..1949a1cd 100644 #ifdef _DEBUG_ dbg_free_final(NULL); #endif --- -2.17.2 - diff --git a/0059-mpathpersist-use-atexit-for-cleanup-handlers.patch b/0059-mpathpersist-use-atexit-for-cleanup-handlers.patch index 7494b34..0c88e70 100644 --- a/0059-mpathpersist-use-atexit-for-cleanup-handlers.patch +++ b/0059-mpathpersist-use-atexit-for-cleanup-handlers.patch @@ -27,6 +27,3 @@ index 3c2e6576..14245cc3 100644 return (ret >= 0) ? ret : MPATH_PR_OTHER; } --- -2.17.2 - diff --git a/0060-multipath-fix-leak-in-check_path_valid.patch b/0060-multipath-fix-leak-in-check_path_valid.patch index c96f4cb..5c82a35 100644 --- a/0060-multipath-fix-leak-in-check_path_valid.patch +++ b/0060-multipath-fix-leak-in-check_path_valid.patch @@ -90,6 +90,3 @@ index 1949a1cd..043d8fa7 100644 } static int --- -2.17.2 - diff --git a/0061-multipath-tools-mpath-tools.supp-file-with-valgrind-.patch b/0061-multipath-tools-mpath-tools.supp-file-with-valgrind-.patch index 4228be6..7eb6471 100644 --- a/0061-multipath-tools-mpath-tools.supp-file-with-valgrind-.patch +++ b/0061-multipath-tools-mpath-tools.supp-file-with-valgrind-.patch @@ -57,6 +57,3 @@ index 00000000..0537fd56 + ... + fun:_dl_init +} --- -2.17.2 - diff --git a/0062-libmultipath-use-libmp_verbosity-to-track-verbosity.patch b/0062-libmultipath-use-libmp_verbosity-to-track-verbosity.patch index 042929d..400656e 100644 --- a/0062-libmultipath-use-libmp_verbosity-to-track-verbosity.patch +++ b/0062-libmultipath-use-libmp_verbosity-to-track-verbosity.patch @@ -436,6 +436,3 @@ index 84a3ba2f..0b42e255 100644 return 0; } --- -2.17.2 - diff --git a/0063-libmultipath-introduce-symbolic-values-for-logsink.patch b/0063-libmultipath-introduce-symbolic-values-for-logsink.patch index 24cf615..936bb6f 100644 --- a/0063-libmultipath-introduce-symbolic-values-for-logsink.patch +++ b/0063-libmultipath-introduce-symbolic-values-for-logsink.patch @@ -180,6 +180,3 @@ index 57f832b7..4dd0873b 100644 struct config *get_multipath_config(void) { --- -2.17.2 - diff --git a/0064-libmultipath-simplify-dlog.patch b/0064-libmultipath-simplify-dlog.patch index af47833..67985a1 100644 --- a/0064-libmultipath-simplify-dlog.patch +++ b/0064-libmultipath-simplify-dlog.patch @@ -147,6 +147,3 @@ index 2c878c63..6d22cd23 100644 void expect_condlog(int prio, char *string); #endif --- -2.17.2 - diff --git a/0065-multipathd-common-code-for-k-and-command-args.patch b/0065-multipathd-common-code-for-k-and-command-args.patch index 1fc5a75..d31afd7 100644 --- a/0065-multipathd-common-code-for-k-and-command-args.patch +++ b/0065-multipathd-common-code-for-k-and-command-args.patch @@ -82,6 +82,3 @@ index 867f0f84..b6a5f5b7 100644 err = uxclnt(s, uxsock_timeout + 100); free_config(conf); return err; --- -2.17.2 - diff --git a/0066-multipathd-sanitize-uxsock_listen.patch b/0066-multipathd-sanitize-uxsock_listen.patch index d7efc72..bffb94c 100644 --- a/0066-multipathd-sanitize-uxsock_listen.patch +++ b/0066-multipathd-sanitize-uxsock_listen.patch @@ -152,6 +152,3 @@ index ce2b6800..cd462b6d 100644 if (polls[i].revents & POLLIN) { struct timespec start_time; --- -2.17.2 - diff --git a/0067-libmultipath-fix-race-between-log_safe-and-log_threa.patch b/0067-libmultipath-fix-race-between-log_safe-and-log_threa.patch index 29f5ce7..cc6e5d3 100644 --- a/0067-libmultipath-fix-race-between-log_safe-and-log_threa.patch +++ b/0067-libmultipath-fix-race-between-log_safe-and-log_threa.patch @@ -102,6 +102,3 @@ index 3a2566ae..0d48c52c 100644 + flush_logqueue(); log_close(); } --- -2.17.2 - diff --git a/0068-multipath-add-libmpathvalid-library.patch b/0068-multipath-add-libmpathvalid-library.patch index 24ba4ac..2a19329 100644 --- a/0068-multipath-add-libmpathvalid-library.patch +++ b/0068-multipath-add-libmpathvalid-library.patch @@ -500,6 +500,3 @@ index 67a7379f..2e3583f5 100644 + dm_prereq; + skip_libmp_dm_init; +} LIBMULTIPATH_4.1.0; --- -2.17.2 - diff --git a/0069-multipath-tools-tests-and-unit-tests-for-libmpathval.patch b/0069-multipath-tools-tests-and-unit-tests-for-libmpathval.patch index cd24d4e..e8a56a3 100644 --- a/0069-multipath-tools-tests-and-unit-tests-for-libmpathval.patch +++ b/0069-multipath-tools-tests-and-unit-tests-for-libmpathval.patch @@ -527,6 +527,3 @@ index 00000000..5ffabb9d + r += test_mpathvalid(); + return r; +} --- -2.17.2 - diff --git a/0070-libmultipath-add-uid-failback-for-dasd-devices.patch b/0070-libmultipath-add-uid-failback-for-dasd-devices.patch index c052217..9a26734 100644 --- a/0070-libmultipath-add-uid-failback-for-dasd-devices.patch +++ b/0070-libmultipath-add-uid-failback-for-dasd-devices.patch @@ -85,6 +85,3 @@ index e7084664..877e8f2b 100644 !strcmp(pp->uid_attribute, "")))); } --- -2.17.2 - diff --git a/0071-libmultipath-change-log-level-for-null-uid_attribute.patch b/0071-libmultipath-change-log-level-for-null-uid_attribute.patch index 3fa6b93..de48c1b 100644 --- a/0071-libmultipath-change-log-level-for-null-uid_attribute.patch +++ b/0071-libmultipath-change-log-level-for-null-uid_attribute.patch @@ -40,6 +40,3 @@ index 877e8f2b..c74f13bf 100644 len = uid_fallback(pp, path_state, &origin); } } --- -2.17.2 - diff --git a/0072-libmultipath-move-fast_io_fail-defines-to-structs.h.patch b/0072-libmultipath-move-fast_io_fail-defines-to-structs.h.patch index 8346fa2..557763c 100644 --- a/0072-libmultipath-move-fast_io_fail-defines-to-structs.h.patch +++ b/0072-libmultipath-move-fast_io_fail-defines-to-structs.h.patch @@ -155,6 +155,3 @@ index 4ce30551..cfa7b649 100644 struct vpd_vendor_page { int pg; const char *name; --- -2.17.2 - diff --git a/0073-libmultipath-add-eh_deadline-multipath.conf-paramete.patch b/0073-libmultipath-add-eh_deadline-multipath.conf-paramete.patch index f5b1d8a..96b8d5c 100644 --- a/0073-libmultipath-add-eh_deadline-multipath.conf-paramete.patch +++ b/0073-libmultipath-add-eh_deadline-multipath.conf-paramete.patch @@ -333,6 +333,3 @@ index 7242d39b..ea66a01e 100644 .B bindings_file The full pathname of the binding file to be used when the user_friendly_names option is set. --- -2.17.2 - diff --git a/0074-multipathd-remove-redundant-vector_free-int-configur.patch b/0074-multipathd-remove-redundant-vector_free-int-configur.patch index c9947f5..5d1fd0a 100644 --- a/0074-multipathd-remove-redundant-vector_free-int-configur.patch +++ b/0074-multipathd-remove-redundant-vector_free-int-configur.patch @@ -32,6 +32,3 @@ index b6a5f5b7..2eab4854 100644 vecs->mpvec = mpvec; /* --- -2.17.2 - diff --git a/0075-libmultipath-factor-out-code-to-get-vpd-page-data.patch b/0075-libmultipath-factor-out-code-to-get-vpd-page-data.patch index fe2ea50..1d7b142 100644 --- a/0075-libmultipath-factor-out-code-to-get-vpd-page-data.patch +++ b/0075-libmultipath-factor-out-code-to-get-vpd-page-data.patch @@ -61,6 +61,3 @@ index add7bb97..f901e9ff 100644 if (pg == 0x80) len = parse_vpd_pg80(buff, str, maxlen); else if (pg == 0x83) --- -2.17.2 - diff --git a/0076-libmultipath-limit-reading-0xc9-vpd-page.patch b/0076-libmultipath-limit-reading-0xc9-vpd-page.patch index 6208fe5..f5483b2 100644 --- a/0076-libmultipath-limit-reading-0xc9-vpd-page.patch +++ b/0076-libmultipath-limit-reading-0xc9-vpd-page.patch @@ -86,6 +86,3 @@ index fa4ac5d9..f771a830 100644 return 0; len = get_vpd_sgio(pp->fd, 0xC9, 0, buff, 44); if (len <= 0) --- -2.17.2 - diff --git a/0077-libmultipath-move-logq_lock-handling-to-log.c.patch b/0077-libmultipath-move-logq_lock-handling-to-log.c.patch index ae9385f..b2799a8 100644 --- a/0077-libmultipath-move-logq_lock-handling-to-log.c.patch +++ b/0077-libmultipath-move-logq_lock-handling-to-log.c.patch @@ -136,6 +136,3 @@ index 0d48c52c..65992101 100644 } void log_thread_stop (void) --- -2.17.2 - diff --git a/0078-libmultipath-protect-logarea-with-logq_lock.patch b/0078-libmultipath-protect-logarea-with-logq_lock.patch index e27aa64..d59a9b8 100644 --- a/0078-libmultipath-protect-logarea-with-logq_lock.patch +++ b/0078-libmultipath-protect-logarea-with-logq_lock.patch @@ -105,6 +105,3 @@ index d2448f6a..fa224e4d 100644 -void free_logarea (void); #endif /* LOG_H */ --- -2.17.2 - diff --git a/0079-libmultipath-prevent-DSO-unloading-with-astray-check.patch b/0079-libmultipath-prevent-DSO-unloading-with-astray-check.patch index 31fd8b4..8a81d79 100644 --- a/0079-libmultipath-prevent-DSO-unloading-with-astray-check.patch +++ b/0079-libmultipath-prevent-DSO-unloading-with-astray-check.patch @@ -279,6 +279,3 @@ index 2e3583f5..751099dc 100644 +global: + start_checker_thread; +} LIBMULTIPATH_4.2.0; --- -2.17.2 - diff --git a/0080-libmultipath-force-map-reload-if-udev-incomplete.patch b/0080-libmultipath-force-map-reload-if-udev-incomplete.patch index 913c438..4de3108 100644 --- a/0080-libmultipath-force-map-reload-if-udev-incomplete.patch +++ b/0080-libmultipath-force-map-reload-if-udev-incomplete.patch @@ -146,6 +146,3 @@ index c076be72..d9fd9cb8 100644 return; } if (cmpp->nextpg != mpp->bestpg) { --- -2.17.2 - diff --git a/0081-multipath-tools-avoid-access-to-etc-localtime.patch b/0081-multipath-tools-avoid-access-to-etc-localtime.patch index 1e67613..1286fa5 100644 --- a/0081-multipath-tools-avoid-access-to-etc-localtime.patch +++ b/0081-multipath-tools-avoid-access-to-etc-localtime.patch @@ -107,6 +107,3 @@ index 2eab4854..4417860b 100644 if (bindings_read_only) conf->bindings_read_only = bindings_read_only; check_alias_settings(conf); --- -2.17.2 - diff --git a/0082-multipath-tools-make-sure-plugin-DSOs-use-symbol-ver.patch b/0082-multipath-tools-make-sure-plugin-DSOs-use-symbol-ver.patch index cc3a633..1dcc7f0 100644 --- a/0082-multipath-tools-make-sure-plugin-DSOs-use-symbol-ver.patch +++ b/0082-multipath-tools-make-sure-plugin-DSOs-use-symbol-ver.patch @@ -144,6 +144,3 @@ index fc6e0e0c..8d34ae32 100644 install: $(LIBS) $(INSTALL_PROGRAM) -m 755 libprio*.so $(DESTDIR)$(libdir) --- -2.17.2 - diff --git a/0083-libmultipath.version-add-missing-symbol.patch b/0083-libmultipath.version-add-missing-symbol.patch index 55e4396..11edbd0 100644 --- a/0083-libmultipath.version-add-missing-symbol.patch +++ b/0083-libmultipath.version-add-missing-symbol.patch @@ -25,6 +25,3 @@ index 751099dc..2228f4ec 100644 +global: + get_next_string; +} LIBMULTIPATH_4.3.0; --- -2.17.2 - diff --git a/0084-multipath-tools-tests-unversioned-.so-for-valgrind-t.patch b/0084-multipath-tools-tests-unversioned-.so-for-valgrind-t.patch index 6be89d6..fa83da7 100644 --- a/0084-multipath-tools-tests-unversioned-.so-for-valgrind-t.patch +++ b/0084-multipath-tools-tests-unversioned-.so-for-valgrind-t.patch @@ -25,6 +25,3 @@ index 54da774e..50673fae 100644 valgrind --leak-check=full --error-exitcode=128 ./$< >$@ 2>&1 OBJS = $(TESTS:%=%.o) $(HELPERS) --- -2.17.2 - diff --git a/0085-multipath-tools-unit-tests-fix-memory-leaks-in-mpath.patch b/0085-multipath-tools-unit-tests-fix-memory-leaks-in-mpath.patch index 3a3bbbf..cfbf24c 100644 --- a/0085-multipath-tools-unit-tests-fix-memory-leaks-in-mpath.patch +++ b/0085-multipath-tools-unit-tests-fix-memory-leaks-in-mpath.patch @@ -48,6 +48,3 @@ index 5ffabb9d..cfe4bae1 100644 } #define setup_test(name) \ --- -2.17.2 - diff --git a/0086-mpathpersist-Fix-Register-and-Ignore-with-0x00-SARK.patch b/0086-mpathpersist-Fix-Register-and-Ignore-with-0x00-SARK.patch index 3e152fc..323176f 100644 --- a/0086-mpathpersist-Fix-Register-and-Ignore-with-0x00-SARK.patch +++ b/0086-mpathpersist-Fix-Register-and-Ignore-with-0x00-SARK.patch @@ -29,6 +29,3 @@ index 79322e86..41789c46 100644 condlog(0, "%s: configured reservation key doesn't match: 0x%" PRIx64, alias, get_be64(mpp->reservation_key)); ret = MPATH_PR_SYNTAX_ERROR; goto out1; --- -2.17.2 - diff --git a/0087-mpathpersist-update-prkeys-file-on-changing-registra.patch b/0087-mpathpersist-update-prkeys-file-on-changing-registra.patch index 79bee15..f555825 100644 --- a/0087-mpathpersist-update-prkeys-file-on-changing-registra.patch +++ b/0087-mpathpersist-update-prkeys-file-on-changing-registra.patch @@ -34,6 +34,3 @@ index 41789c46..08077936 100644 memcpy(&mpp->reservation_key, paramp->sa_key, 8); if (update_prkey_flags(alias, get_be64(mpp->reservation_key), paramp->sa_flags)) { --- -2.17.2 - diff --git a/0088-libmultipath-warn-about-missing-braces-at-end-of-mul.patch b/0088-libmultipath-warn-about-missing-braces-at-end-of-mul.patch index bbb9f13..4534b41 100644 --- a/0088-libmultipath-warn-about-missing-braces-at-end-of-mul.patch +++ b/0088-libmultipath-warn-about-missing-braces-at-end-of-mul.patch @@ -37,6 +37,3 @@ index 163ffbc9..c70243c3 100644 out: FREE(buf); free_uniques(uniques); --- -2.17.2 - diff --git a/0089-libmultipath-ignore-multipaths-sections-without-wwid.patch b/0089-libmultipath-ignore-multipaths-sections-without-wwid.patch index 25aa7ea..f49f461 100644 --- a/0089-libmultipath-ignore-multipaths-sections-without-wwid.patch +++ b/0089-libmultipath-ignore-multipaths-sections-without-wwid.patch @@ -32,6 +32,3 @@ index 9f3cb38d..a643703e 100644 j = i + 1; vector_foreach_slot_after(mptable, mp2, j) { if (strcmp(mp1->wwid, mp2->wwid)) --- -2.17.2 - diff --git a/0090-libmultipath-fix-format-warning-with-clang.patch b/0090-libmultipath-fix-format-warning-with-clang.patch index 931e81c..24bbe92 100644 --- a/0090-libmultipath-fix-format-warning-with-clang.patch +++ b/0090-libmultipath-fix-format-warning-with-clang.patch @@ -23,6 +23,3 @@ index 6498c88c..10fa32cd 100644 static int _log_enqueue(int prio, const char * fmt, va_list ap) { int len, fwd; --- -2.17.2 - diff --git a/0091-libmultipath-check-for-null-wwid-before-strcmp.patch b/0091-libmultipath-check-for-null-wwid-before-strcmp.patch index 1f6894d..3162352 100644 --- a/0091-libmultipath-check-for-null-wwid-before-strcmp.patch +++ b/0091-libmultipath-check-for-null-wwid-before-strcmp.patch @@ -29,6 +29,3 @@ index a643703e..be310159 100644 continue; condlog(1, "%s: duplicate multipath config section for %s", __func__, mp1->wwid); --- -2.17.2 - diff --git a/0092-multipath.conf.5-Improve-checker_timeout-description.patch b/0092-multipath.conf.5-Improve-checker_timeout-description.patch index 120c637..09f108c 100644 --- a/0092-multipath.conf.5-Improve-checker_timeout-description.patch +++ b/0092-multipath.conf.5-Improve-checker_timeout-description.patch @@ -60,6 +60,3 @@ index ea66a01e..8ef3a747 100644 .RS .TP The default is: in \fB/sys/block/sd/device/timeout\fR --- -2.17.2 - diff --git a/0093-multipathd-fix-path-checkint-not-changed-when-path-s.patch b/0093-multipathd-fix-path-checkint-not-changed-when-path-s.patch index 868fa18..0fa29be 100644 --- a/0093-multipathd-fix-path-checkint-not-changed-when-path-s.patch +++ b/0093-multipathd-fix-path-checkint-not-changed-when-path-s.patch @@ -31,6 +31,3 @@ index 4417860b..7612430a 100644 return 1; } if (!pp->mpp) { --- -2.17.2 - diff --git a/0094-libmultipath-select_action-skip-is_mpp_known_to_udev.patch b/0094-libmultipath-select_action-skip-is_mpp_known_to_udev.patch index e37e4da..b129afa 100644 --- a/0094-libmultipath-select_action-skip-is_mpp_known_to_udev.patch +++ b/0094-libmultipath-select_action-skip-is_mpp_known_to_udev.patch @@ -46,6 +46,3 @@ index d9fd9cb8..999f3106 100644 mpp->action = ACT_NOTHING; condlog(3, "%s: set ACT_NOTHING (map unchanged)", mpp->alias); --- -2.17.2 - diff --git a/0095-libmultipath-coalesce_paths-stop-triggering-spurious.patch b/0095-libmultipath-coalesce_paths-stop-triggering-spurious.patch index 033525b..0f8e520 100644 --- a/0095-libmultipath-coalesce_paths-stop-triggering-spurious.patch +++ b/0095-libmultipath-coalesce_paths-stop-triggering-spurious.patch @@ -60,6 +60,3 @@ index 999f3106..3263bb01 100644 conf = get_multipath_config(); allow_queueing = conf->allow_queueing; put_multipath_config(conf); --- -2.17.2 - diff --git a/0096-Revert-multipathd-uev_trigger-handle-incomplete-ADD-.patch b/0096-Revert-multipathd-uev_trigger-handle-incomplete-ADD-.patch index 79912f0..49cf1b0 100644 --- a/0096-Revert-multipathd-uev_trigger-handle-incomplete-ADD-.patch +++ b/0096-Revert-multipathd-uev_trigger-handle-incomplete-ADD-.patch @@ -56,6 +56,3 @@ index 7612430a..92c45d44 100644 } goto out; } --- -2.17.2 - diff --git a/0097-libmultipath-make-find_err_path_by_dev-static.patch b/0097-libmultipath-make-find_err_path_by_dev-static.patch index a19afc4..19f0a01 100644 --- a/0097-libmultipath-make-find_err_path_by_dev-static.patch +++ b/0097-libmultipath-make-find_err_path_by_dev-static.patch @@ -22,6 +22,3 @@ index 5363049d..2e48ee81 100644 { int i; struct io_err_stat_path *pp; --- -2.17.2 - diff --git a/0098-multipathd-avoid-io_err_stat-crash-during-shutdown.patch b/0098-multipathd-avoid-io_err_stat-crash-during-shutdown.patch index 4c21465..2cab5a8 100644 --- a/0098-multipathd-avoid-io_err_stat-crash-during-shutdown.patch +++ b/0098-multipathd-avoid-io_err_stat-crash-during-shutdown.patch @@ -252,6 +252,3 @@ index 2e48ee81..feb66469 100644 + free_io_err_pathvec(); io_destroy(ioctx); } --- -2.17.2 - diff --git a/0099-multipathd-avoid-io_err_stat-ABBA-deadlock.patch b/0099-multipathd-avoid-io_err_stat-ABBA-deadlock.patch index 30584f6..e6bf72d 100644 --- a/0099-multipathd-avoid-io_err_stat-ABBA-deadlock.patch +++ b/0099-multipathd-avoid-io_err_stat-ABBA-deadlock.patch @@ -141,6 +141,3 @@ index feb66469..775e7259 100644 } static void cleanup_exited(__attribute__((unused)) void *arg) --- -2.17.2 - diff --git a/0100-multipathd-use-get_monotonic_time-in-io_err_stat-cod.patch b/0100-multipathd-use-get_monotonic_time-in-io_err_stat-cod.patch index 89d9f73..a5ef865 100644 --- a/0100-multipathd-use-get_monotonic_time-in-io_err_stat-cod.patch +++ b/0100-multipathd-use-get_monotonic_time-in-io_err_stat-cod.patch @@ -106,6 +106,3 @@ index 775e7259..92871f40 100644 vector_foreach_slot(io_err_pathvec, pp, i) { for (j = 0; j < CONCUR_NR_EVENT; j++) { rc = try_to_cancel_timeout_io(pp->dio_ctx_array + j, --- -2.17.2 - diff --git a/0101-multipathd-combine-free_io_err_stat_path-and-destroy.patch b/0101-multipathd-combine-free_io_err_stat_path-and-destroy.patch index 90fd516..d6d015e 100644 --- a/0101-multipathd-combine-free_io_err_stat_path-and-destroy.patch +++ b/0101-multipathd-combine-free_io_err_stat_path-and-destroy.patch @@ -96,6 +96,3 @@ index 92871f40..bf78a236 100644 free_io_err_stat_path(pp); } vector_reset(tmp_pathvec); --- -2.17.2 - diff --git a/0102-multipathd-cleanup-logging-for-marginal-paths.patch b/0102-multipathd-cleanup-logging-for-marginal-paths.patch index 79ad137..a88c07b 100644 --- a/0102-multipathd-cleanup-logging-for-marginal-paths.patch +++ b/0102-multipathd-cleanup-logging-for-marginal-paths.patch @@ -118,6 +118,3 @@ index 92c45d44..99a89a69 100644 else if (update_prio(pp, new_path_up) && (pp->mpp->pgpolicyfn == (pgpolicyfn *)group_by_prio) && pp->mpp->pgfailback == -FAILBACK_IMMEDIATE) { --- -2.17.2 - diff --git a/0103-libmultipath-fix-NULL-dereference-in-find_path_by_de.patch b/0103-libmultipath-fix-NULL-dereference-in-find_path_by_de.patch index 4dd4051..e115e58 100644 --- a/0103-libmultipath-fix-NULL-dereference-in-find_path_by_de.patch +++ b/0103-libmultipath-fix-NULL-dereference-in-find_path_by_de.patch @@ -41,6 +41,3 @@ index 464596fc..a3f27fd6 100644 return NULL; vector_foreach_slot (pathvec, pp, i) --- -2.17.2 - diff --git a/0104-libmultipath-snprint_devices-avoid-NULL-dereference.patch b/0104-libmultipath-snprint_devices-avoid-NULL-dereference.patch index 04ff739..4ddae1c 100644 --- a/0104-libmultipath-snprint_devices-avoid-NULL-dereference.patch +++ b/0104-libmultipath-snprint_devices-avoid-NULL-dereference.patch @@ -33,6 +33,3 @@ index 19de2c7c..8151e11e 100644 fwd += snprintf(buff + fwd, len - fwd, " %s", devname); if (fwd >= len) --- -2.17.2 - diff --git a/0105-libmpathpersist-fix-thread-safety-of-default-functio.patch b/0105-libmpathpersist-fix-thread-safety-of-default-functio.patch index dad9963..e21e27c 100644 --- a/0105-libmpathpersist-fix-thread-safety-of-default-functio.patch +++ b/0105-libmpathpersist-fix-thread-safety-of-default-functio.patch @@ -269,6 +269,3 @@ index 5435eae4..9e9c0a82 100644 */ void mpath_persistent_reserve_free_vecs(void); --- -2.17.2 - diff --git a/0106-Added-github-action-for-building.patch b/0106-Added-github-action-for-building.patch index 8a8a7d0..9622788 100644 --- a/0106-Added-github-action-for-building.patch +++ b/0106-Added-github-action-for-building.patch @@ -32,6 +32,3 @@ index 00000000..2b13c65c + run: make -O -j$(grep -c ^processor /proc/cpuinfo) + - name: test + run: make -O -j$(grep -c ^processor /proc/cpuinfo) test --- -2.17.2 - diff --git a/0107-github-workflow-use-zram-device-as-test-block-device.patch b/0107-github-workflow-use-zram-device-as-test-block-device.patch index 5b25c29..4a2d179 100644 --- a/0107-github-workflow-use-zram-device-as-test-block-device.patch +++ b/0107-github-workflow-use-zram-device-as-test-block-device.patch @@ -35,6 +35,3 @@ index 2b13c65c..ef55b8c1 100644 + run: rm -f tests/dmevents.out tests/directio.out + - name: root-test + run: sudo make DIO_TEST_DEV=/dev/zram$ZRAM test --- -2.17.2 - diff --git a/0108-github-workflow-use-explicit-Ubuntu-version.patch b/0108-github-workflow-use-explicit-Ubuntu-version.patch index ff565d6..f9b2336 100644 --- a/0108-github-workflow-use-explicit-Ubuntu-version.patch +++ b/0108-github-workflow-use-explicit-Ubuntu-version.patch @@ -21,6 +21,3 @@ index ef55b8c1..577a14ac 100644 steps: - uses: actions/checkout@v2 - name: mpath --- -2.17.2 - diff --git a/0109-github-workflow-add-valgrind-tests.patch b/0109-github-workflow-add-valgrind-tests.patch index 5c4e366..fc5f15c 100644 --- a/0109-github-workflow-add-valgrind-tests.patch +++ b/0109-github-workflow-add-valgrind-tests.patch @@ -31,6 +31,3 @@ index 577a14ac..929f63a6 100644 - name: clean-nonroot-artifacts run: rm -f tests/dmevents.out tests/directio.out - name: root-test --- -2.17.2 - diff --git a/0110-github-workflow-run-apt-get-update.patch b/0110-github-workflow-run-apt-get-update.patch index d27f1ca..f257ffc 100644 --- a/0110-github-workflow-run-apt-get-update.patch +++ b/0110-github-workflow-run-apt-get-update.patch @@ -23,6 +23,3 @@ index 929f63a6..389578be 100644 - name: dependencies run: > sudo apt-get install --yes gcc --- -2.17.2 - diff --git a/0111-github-workflow-add-tests-with-gcc-10-and-clang.patch b/0111-github-workflow-add-tests-with-gcc-10-and-clang.patch index e95b3f8..a328464 100644 --- a/0111-github-workflow-add-tests-with-gcc-10-and-clang.patch +++ b/0111-github-workflow-add-tests-with-gcc-10-and-clang.patch @@ -85,6 +85,3 @@ index 389578be..4173576f 100644 + run: rm -f tests/dmevents.out tests/directio.out + - name: root-test + run: sudo make DIO_TEST_DEV=/dev/ram0 test --- -2.17.2 - diff --git a/0112-multipathd-Fix-multipathd-stopping-on-shutdown.patch b/0112-multipathd-Fix-multipathd-stopping-on-shutdown.patch index 49ea563..d18b363 100644 --- a/0112-multipathd-Fix-multipathd-stopping-on-shutdown.patch +++ b/0112-multipathd-Fix-multipathd-stopping-on-shutdown.patch @@ -33,6 +33,3 @@ index ba24983e..7d547fa7 100644 After=multipathd.socket systemd-udev-trigger.service systemd-udev-settle.service DefaultDependencies=no Conflicts=shutdown.target --- -2.17.2 - diff --git a/0113-libmultipath-use-3rd-digit-as-transport_id-for-expan.patch b/0113-libmultipath-use-3rd-digit-as-transport_id-for-expan.patch index 17d53ce..a83d7bd 100644 --- a/0113-libmultipath-use-3rd-digit-as-transport_id-for-expan.patch +++ b/0113-libmultipath-use-3rd-digit-as-transport_id-for-expan.patch @@ -40,6 +40,3 @@ index e818585a..6d74cc07 100644 tgtdev = udev_device_get_parent(tgtdev); tgtid = -1; } --- -2.17.2 - diff --git a/0114-libmultipath-sysfs_set_nexus_loss_tmo-support-SAS-ex.patch b/0114-libmultipath-sysfs_set_nexus_loss_tmo-support-SAS-ex.patch index 3207d2d..1eccb08 100644 --- a/0114-libmultipath-sysfs_set_nexus_loss_tmo-support-SAS-ex.patch +++ b/0114-libmultipath-sysfs_set_nexus_loss_tmo-support-SAS-ex.patch @@ -52,6 +52,3 @@ index 6d74cc07..921025d4 100644 sas_dev = udev_device_new_from_subsystem_sysname(udev, "sas_end_device", end_dev_id); if (!sas_dev) { --- -2.17.2 - diff --git a/0115-multipathd-add-code-to-initalize-unwinder.patch b/0115-multipathd-add-code-to-initalize-unwinder.patch index e231733..b2ccb84 100644 --- a/0115-multipathd-add-code-to-initalize-unwinder.patch +++ b/0115-multipathd-add-code-to-initalize-unwinder.patch @@ -129,6 +129,3 @@ index 99a89a69..6f851ae8 100644 mlockall(MCL_CURRENT | MCL_FUTURE); signal_init(); mp_rcu_data = setup_rcu(); --- -2.17.2 - diff --git a/0116-libmultipath-check-if-adopt_path-really-added-curren.patch b/0116-libmultipath-check-if-adopt_path-really-added-curren.patch index b656c08..195e9ed 100644 --- a/0116-libmultipath-check-if-adopt_path-really-added-curren.patch +++ b/0116-libmultipath-check-if-adopt_path-really-added-curren.patch @@ -52,6 +52,3 @@ index 6f851ae8..43d77688 100644 goto fail; /* leave path added to pathvec */ verify_paths(mpp); --- -2.17.2 - diff --git a/0117-multipathd-ev_add_path-fail-if-add_map_with_path-fai.patch b/0117-multipathd-ev_add_path-fail-if-add_map_with_path-fai.patch index f223728..1bff1e5 100644 --- a/0117-multipathd-ev_add_path-fail-if-add_map_with_path-fai.patch +++ b/0117-multipathd-ev_add_path-fail-if-add_map_with_path-fai.patch @@ -26,6 +26,3 @@ index 43d77688..425492a9 100644 goto fail; /* leave path added to pathvec */ } --- -2.17.2 - diff --git a/0118-libmultipath-check-return-value-of-udev_device_get_d.patch b/0118-libmultipath-check-return-value-of-udev_device_get_d.patch index fe69708..711e00f 100644 --- a/0118-libmultipath-check-return-value-of-udev_device_get_d.patch +++ b/0118-libmultipath-check-return-value-of-udev_device_get_d.patch @@ -26,6 +26,3 @@ index 921025d4..15cf6413 100644 snprintf(pp->dev_t, BLK_DEV_SIZE, "%d:%d", major(devt), minor(devt)); condlog(4, "%s: dev_t = %s", pp->dev, pp->dev_t); --- -2.17.2 - diff --git a/0119-pathinfo-call-filter_property-after-sysfs_pathinfo.patch b/0119-pathinfo-call-filter_property-after-sysfs_pathinfo.patch index cf106c2..660ba85 100644 --- a/0119-pathinfo-call-filter_property-after-sysfs_pathinfo.patch +++ b/0119-pathinfo-call-filter_property-after-sysfs_pathinfo.patch @@ -276,6 +276,3 @@ index 693c72c5..8ec803e8 100644 assert_int_equal(is_path_valid(name, &conf, &pp, false), PATH_IS_NOT_VALID); } --- -2.17.2 - diff --git a/0120-libmultipath-pathinfo-call-filter_property-only-with.patch b/0120-libmultipath-pathinfo-call-filter_property-only-with.patch index c4c8efc..62c930b 100644 --- a/0120-libmultipath-pathinfo-call-filter_property-only-with.patch +++ b/0120-libmultipath-pathinfo-call-filter_property-only-with.patch @@ -83,6 +83,3 @@ index 960a7665..f5542ed0 100644 if (mp->flags & BL_BY_DEVICE && (mask & DI_BLACKLIST && mask & DI_SYSFS)) --- -2.17.2 - diff --git a/0121-multipath-w-allow-removing-blacklisted-paths.patch b/0121-multipath-w-allow-removing-blacklisted-paths.patch index db6fe52..6b3e4f7 100644 --- a/0121-multipath-w-allow-removing-blacklisted-paths.patch +++ b/0121-multipath-w-allow-removing-blacklisted-paths.patch @@ -34,6 +34,3 @@ index 3263bb01..598efe05 100644 filter_wwid(conf->blist_wwid, conf->elist_wwid, refwwid, NULL) > 0) return PATHINFO_SKIPPED; --- -2.17.2 - diff --git a/0122-libmultipath-fix-use-after-free-in-uev_add_path.patch b/0122-libmultipath-fix-use-after-free-in-uev_add_path.patch index 6a5fcad..921a0cc 100644 --- a/0122-libmultipath-fix-use-after-free-in-uev_add_path.patch +++ b/0122-libmultipath-fix-use-after-free-in-uev_add_path.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski -Date: Mon, 1 Feb 2021 19:47:11 -0600 +Date: Mon, 8 Feb 2021 23:19:26 -0600 Subject: [PATCH] libmultipath: fix use-after-free in uev_add_path if ev_remove_path() returns success the path has very likely been @@ -11,6 +11,7 @@ Insted, uev_add_path() should only continue to access the path if ev_remove_path() didn't succeed. Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck --- multipathd/main.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) @@ -48,6 +49,3 @@ index 425492a9..19679848 100644 } else if (r == PATHINFO_SKIPPED) { condlog(3, "%s: remove blacklisted path", uev->kernel); --- -2.17.2 - diff --git a/0123-multipath-tools-tests-fix-stringop-overflow-build-er.patch b/0123-multipath-tools-tests-fix-stringop-overflow-build-er.patch new file mode 100644 index 0000000..bb199f5 --- /dev/null +++ b/0123-multipath-tools-tests-fix-stringop-overflow-build-er.patch @@ -0,0 +1,52 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 10 Feb 2021 13:15:17 +0100 +Subject: [PATCH] multipath-tools tests: fix stringop-overflow build errors + with gcc 11 + +gcc-11 throws an error compiling alias.c and dmevents.c: + +In file included from ../libmultipath/checkers.h:4, + from ../libmultipath/prio.h:7, + from ../libmultipath/structs.h:8, + from dmevents.c:29: +../multipathd/dmevents.c: In function 'dmevent_loop': +../multipathd/dmevents.c:357:17: error: '__sigsetjmp' accessing 200 bytes in a region of size 72 [-Werror=stringop-overflow=] + 357 | pthread_cleanup_push(cleanup_lock, &waiter->vecs->lock); + | ^~~~~~~~~~~~~~~~~~~~ +../multipathd/dmevents.c:357:17: note: referencing argument 1 of type 'struct __jmp_buf_tag *' +/usr/include/pthread.h:734:12: note: in a call to function '__sigsetjmp' + 734 | extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __THROWNL; + | ^~~~~~~~~~~ + +The reason seems to be a mismatch between the __sigsetjmp() prototype +in and . The error is encountered iUntil this is fixed in the toolchain, +work around it by including before . + +Signed-off-by: Benjamin Marzinski +--- + tests/alias.c | 1 + + tests/dmevents.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/tests/alias.c b/tests/alias.c +index 0311faa6..5e0bfea3 100644 +--- a/tests/alias.c ++++ b/tests/alias.c +@@ -1,3 +1,4 @@ ++#include + #include + #include + #include +diff --git a/tests/dmevents.c b/tests/dmevents.c +index b7c5122b..29eaa6db 100644 +--- a/tests/dmevents.c ++++ b/tests/dmevents.c +@@ -16,6 +16,7 @@ + * + */ + ++#include + #include + #include + #include diff --git a/0124-libmultipath-cleanup-code-to-strip-wwid-trailing-spa.patch b/0124-libmultipath-cleanup-code-to-strip-wwid-trailing-spa.patch new file mode 100644 index 0000000..0d4a25e --- /dev/null +++ b/0124-libmultipath-cleanup-code-to-strip-wwid-trailing-spa.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 24 Feb 2021 00:33:20 -0600 +Subject: [PATCH] libmultipath: cleanup code to strip wwid trailing spaces + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + libmultipath/discovery.c | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index 9be94cd1..3a06f319 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -2152,11 +2152,11 @@ int + get_uid (struct path * pp, int path_state, struct udev_device *udev, + int allow_fallback) + { +- char *c; + const char *origin = "unknown"; + ssize_t len = 0; + struct config *conf; + int used_fallback = 0; ++ size_t i; + + if (!pp->uid_attribute && !pp->getuid) { + conf = get_multipath_config(); +@@ -2210,12 +2210,9 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev, + return 1; + } else { + /* Strip any trailing blanks */ +- c = strchr(pp->wwid, '\0'); +- c--; +- while (c && c >= pp->wwid && *c == ' ') { +- *c = '\0'; +- c--; +- } ++ for (i = strlen(pp->wwid); i > 0 && pp->wwid[i-1] == ' '; i--); ++ /* no-op */ ++ pp->wwid[i] = '\0'; + } + condlog((used_fallback)? 1 : 3, "%s: uid = %s (%s)", pp->dev, + *pp->wwid == '\0' ? "" : pp->wwid, origin); diff --git a/0125-libmultipath-cleanup-uid_attribute-checking-code.patch b/0125-libmultipath-cleanup-uid_attribute-checking-code.patch new file mode 100644 index 0000000..56e473d --- /dev/null +++ b/0125-libmultipath-cleanup-uid_attribute-checking-code.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 24 Feb 2021 00:33:21 -0600 +Subject: [PATCH] libmultipath: cleanup uid_attribute checking code + +In get_uid(), if pp->getuid is NULL, multipath will check the +pp->uid_attribute to get the wwid. If pp->uid_attribute is NULL, +nothing will happen in that block of code, because both udev_available +and has_uid_fallback() are false if pp->uid_attribute is NULL. So +instead of multiple checks if pp->uid_attribute is NULL, just check once +for the code block. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + libmultipath/discovery.c | 17 ++++++++--------- + 1 file changed, 8 insertions(+), 9 deletions(-) + +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index 3a06f319..40727fa3 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -2183,22 +2183,21 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev, + } else + len = strlen(pp->wwid); + origin = "callout"; +- } else { +- bool valid_uid_attr = pp->uid_attribute +- && *pp->uid_attribute; +- bool empty_uid_attr = pp->uid_attribute +- && !*pp->uid_attribute; +- bool udev_available = udev && valid_uid_attr; ++ } else if (pp->uid_attribute) { ++ /* if the uid_attribute is an empty string skip udev checking */ ++ bool check_uid_attr = udev && *pp->uid_attribute; + +- if (udev_available) { ++ if (check_uid_attr) { + len = get_udev_uid(pp, pp->uid_attribute, udev); + origin = "udev"; + if (len == 0) + condlog(1, "%s: empty udev uid", pp->dev); + } +- if ((!udev_available || (len <= 0 && allow_fallback)) ++ if ((!check_uid_attr || (len <= 0 && allow_fallback)) + && has_uid_fallback(pp)) { +- if (!udev || !empty_uid_attr) ++ /* if udev wasn't set or we failed in get_udev_uid() ++ * log at a higher priority */ ++ if (!udev || check_uid_attr) + used_fallback = 1; + len = uid_fallback(pp, path_state, &origin); + } diff --git a/0126-multipathd-add-recheck_wwid-option-to-verify-the-pat.patch b/0126-multipathd-add-recheck_wwid-option-to-verify-the-pat.patch new file mode 100644 index 0000000..27bc16c --- /dev/null +++ b/0126-multipathd-add-recheck_wwid-option-to-verify-the-pat.patch @@ -0,0 +1,453 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 24 Feb 2021 00:33:22 -0600 +Subject: [PATCH] multipathd: add recheck_wwid option to verify the path wwid + +There are cases where the wwid of a path changes due to LUN remapping +without triggering uevent for the changed path. Multipathd has no method +for trying to catch these cases, and corruption has resulted because of +it. + +In order to have a better chance at catching these cases, multipath now +has a recheck_wwid option. If this is set to "yes", when a failed path +has become active again, multipathd will recheck its wwid. If multipathd +notices that a path's wwid has changed, it will remove and re-add the +path, just like the existing wwid checking code for change events does. +In cases where the no uevent occurs, both the udev database entry and +sysfs will have the old wwid, so the only way to get a current wwid is +to ask the device directly. Currently multipath only has code to +directly get the wwid for scsi devices, so this option only effects scsi +devices, and they must be configured to be able to use the uid_fallback +methods. To make sure both the sysfs and udev database values are +updated, multipathd triggers a both a rescan of the device and a udev +add event. + +Co-developed-by: Chongyun Wu +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck Reviewed-by: Martin Wilck +--- + libmultipath/config.c | 2 + + libmultipath/config.h | 2 + + libmultipath/configure.c | 4 +- + libmultipath/configure.h | 2 + + libmultipath/defaults.h | 1 + + libmultipath/dict.c | 11 +++++ + libmultipath/discovery.c | 7 ++- + libmultipath/discovery.h | 1 + + libmultipath/libmultipath.version | 6 +++ + libmultipath/propsel.c | 21 +++++++++ + libmultipath/propsel.h | 1 + + libmultipath/structs.h | 7 +++ + multipath/multipath.conf.5 | 14 ++++++ + multipathd/cli_handlers.c | 9 ++++ + multipathd/main.c | 78 +++++++++++++++++++++++++++++++ + multipathd/main.h | 2 + + 16 files changed, 164 insertions(+), 4 deletions(-) + +diff --git a/libmultipath/config.c b/libmultipath/config.c +index be310159..30046a17 100644 +--- a/libmultipath/config.c ++++ b/libmultipath/config.c +@@ -436,6 +436,7 @@ merge_hwe (struct hwentry * dst, struct hwentry * src) + merge_num(max_sectors_kb); + merge_num(ghost_delay); + merge_num(all_tg_pt); ++ merge_num(recheck_wwid); + merge_num(vpd_vendor_id); + merge_num(san_path_err_threshold); + merge_num(san_path_err_forget_rate); +@@ -867,6 +868,7 @@ int _init_config (const char *file, struct config *conf) + conf->remove_retries = 0; + conf->ghost_delay = DEFAULT_GHOST_DELAY; + conf->all_tg_pt = DEFAULT_ALL_TG_PT; ++ conf->recheck_wwid = DEFAULT_RECHECK_WWID; + /* + * preload default hwtable + */ +diff --git a/libmultipath/config.h b/libmultipath/config.h +index 9ce37f16..933fe0d1 100644 +--- a/libmultipath/config.h ++++ b/libmultipath/config.h +@@ -83,6 +83,7 @@ struct hwentry { + int ghost_delay; + int all_tg_pt; + int vpd_vendor_id; ++ int recheck_wwid; + char * bl_product; + }; + +@@ -187,6 +188,7 @@ struct config { + int marginal_pathgroups; + int skip_delegate; + unsigned int sequence_nr; ++ int recheck_wwid; + + char * multipath_dir; + char * selector; +diff --git a/libmultipath/configure.c b/libmultipath/configure.c +index 598efe05..6ca1f4bb 100644 +--- a/libmultipath/configure.c ++++ b/libmultipath/configure.c +@@ -527,8 +527,8 @@ get_udev_for_mpp(const struct multipath *mpp) + return udd; + } + +-static void trigger_partitions_udev_change(struct udev_device *dev, +- const char *action, int len) ++void trigger_partitions_udev_change(struct udev_device *dev, ++ const char *action, int len) + { + struct udev_enumerate *part_enum; + struct udev_list_entry *item; +diff --git a/libmultipath/configure.h b/libmultipath/configure.h +index 6b23ccbb..70cf77a3 100644 +--- a/libmultipath/configure.h ++++ b/libmultipath/configure.h +@@ -58,3 +58,5 @@ int get_refwwid (enum mpath_cmds cmd, const char *dev, enum devtypes dev_type, + vector pathvec, char **wwid); + struct udev_device *get_udev_device(const char *dev, enum devtypes dev_type); + void trigger_paths_udev_change(struct multipath *mpp, bool is_mpath); ++void trigger_partitions_udev_change(struct udev_device *dev, const char *action, ++ int len); +diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h +index 947ba467..c27946c7 100644 +--- a/libmultipath/defaults.h ++++ b/libmultipath/defaults.h +@@ -53,6 +53,7 @@ + #define DEFAULT_FIND_MULTIPATHS_TIMEOUT -10 + #define DEFAULT_UNKNOWN_FIND_MULTIPATHS_TIMEOUT 1 + #define DEFAULT_ALL_TG_PT ALL_TG_PT_OFF ++#define DEFAULT_RECHECK_WWID RECHECK_WWID_OFF + /* Enable no foreign libraries by default */ + #define DEFAULT_ENABLE_FOREIGN "NONE" + +diff --git a/libmultipath/dict.c b/libmultipath/dict.c +index bab96146..dd08abf5 100644 +--- a/libmultipath/dict.c ++++ b/libmultipath/dict.c +@@ -1401,6 +1401,14 @@ declare_hw_snprint(all_tg_pt, print_yes_no_undef) + declare_def_handler(marginal_pathgroups, set_yes_no) + declare_def_snprint(marginal_pathgroups, print_yes_no) + ++declare_def_handler(recheck_wwid, set_yes_no_undef) ++declare_def_snprint_defint(recheck_wwid, print_yes_no_undef, DEFAULT_RECHECK_WWID) ++declare_ovr_handler(recheck_wwid, set_yes_no_undef) ++declare_ovr_snprint(recheck_wwid, print_yes_no_undef) ++declare_hw_handler(recheck_wwid, set_yes_no_undef) ++declare_hw_snprint(recheck_wwid, print_yes_no_undef) ++ ++ + static int + def_uxsock_timeout_handler(struct config *conf, vector strvec) + { +@@ -1819,6 +1827,7 @@ init_keywords(vector keywords) + install_keyword("enable_foreign", &def_enable_foreign_handler, + &snprint_def_enable_foreign); + install_keyword("marginal_pathgroups", &def_marginal_pathgroups_handler, &snprint_def_marginal_pathgroups); ++ install_keyword("recheck_wwid", &def_recheck_wwid_handler, &snprint_def_recheck_wwid); + __deprecated install_keyword("default_selector", &def_selector_handler, NULL); + __deprecated install_keyword("default_path_grouping_policy", &def_pgpolicy_handler, NULL); + __deprecated install_keyword("default_uid_attribute", &def_uid_attribute_handler, NULL); +@@ -1908,6 +1917,7 @@ init_keywords(vector keywords) + install_keyword("ghost_delay", &hw_ghost_delay_handler, &snprint_hw_ghost_delay); + install_keyword("all_tg_pt", &hw_all_tg_pt_handler, &snprint_hw_all_tg_pt); + install_keyword("vpd_vendor", &hw_vpd_vendor_handler, &snprint_hw_vpd_vendor); ++ install_keyword("recheck_wwid", &hw_recheck_wwid_handler, &snprint_hw_recheck_wwid); + install_sublevel_end(); + + install_keyword_root("overrides", &overrides_handler); +@@ -1949,6 +1959,7 @@ init_keywords(vector keywords) + install_keyword("max_sectors_kb", &ovr_max_sectors_kb_handler, &snprint_ovr_max_sectors_kb); + install_keyword("ghost_delay", &ovr_ghost_delay_handler, &snprint_ovr_ghost_delay); + install_keyword("all_tg_pt", &ovr_all_tg_pt_handler, &snprint_ovr_all_tg_pt); ++ install_keyword("recheck_wwid", &ovr_recheck_wwid_handler, &snprint_ovr_recheck_wwid); + + install_keyword_root("multipaths", &multipaths_handler); + install_keyword_multi("multipath", &multipath_handler, NULL); +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index 40727fa3..f216a724 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -2127,7 +2127,7 @@ static ssize_t uid_fallback(struct path *pp, int path_state, + return len; + } + +-static bool has_uid_fallback(struct path *pp) ++bool has_uid_fallback(struct path *pp) + { + /* + * Falling back to direct WWID determination is dangerous +@@ -2162,6 +2162,7 @@ get_uid (struct path * pp, int path_state, struct udev_device *udev, + conf = get_multipath_config(); + pthread_cleanup_push(put_multipath_config, conf); + select_getuid(conf, pp); ++ select_recheck_wwid(conf, pp); + pthread_cleanup_pop(1); + } + +@@ -2293,8 +2294,10 @@ int pathinfo(struct path *pp, struct config *conf, int mask) + + if (mask & DI_BLACKLIST && mask & DI_SYSFS) { + /* uid_attribute is required for filter_property() */ +- if (pp->udev && !pp->uid_attribute) ++ if (pp->udev && !pp->uid_attribute) { + select_getuid(conf, pp); ++ select_recheck_wwid(conf, pp); ++ } + + if (filter_property(conf, pp->udev, 4, pp->uid_attribute) > 0 || + filter_device(conf->blist_device, conf->elist_device, +diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h +index d3193daf..a5446b4d 100644 +--- a/libmultipath/discovery.h ++++ b/libmultipath/discovery.h +@@ -54,6 +54,7 @@ ssize_t sysfs_get_inquiry(struct udev_device *udev, + unsigned char *buff, size_t len); + int sysfs_get_asymmetric_access_state(struct path *pp, + char *buff, int buflen); ++bool has_uid_fallback(struct path *pp); + int get_uid(struct path * pp, int path_state, struct udev_device *udev, + int allow_fallback); + bool is_vpd_page_supported(int fd, int pg); +diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version +index 2228f4ec..e9b4608f 100644 +--- a/libmultipath/libmultipath.version ++++ b/libmultipath/libmultipath.version +@@ -280,3 +280,9 @@ LIBMULTIPATH_4.4.0 { + global: + get_next_string; + } LIBMULTIPATH_4.3.0; ++ ++LIBMULITIPATH_4.5.0 { ++global: ++ get_vpd_sgio; ++ trigger_partitions_udev_change; ++} LIBMULTIPATH_4.4.0; +diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c +index f771a830..b7b33791 100644 +--- a/libmultipath/propsel.c ++++ b/libmultipath/propsel.c +@@ -581,6 +581,27 @@ out: + return 0; + } + ++/* must be called after select_getuid */ ++int select_recheck_wwid(struct config *conf, struct path * pp) ++{ ++ const char *origin; ++ ++ pp_set_ovr(recheck_wwid); ++ pp_set_hwe(recheck_wwid); ++ pp_set_conf(recheck_wwid); ++ pp_set_default(recheck_wwid, DEFAULT_RECHECK_WWID); ++out: ++ if (pp->recheck_wwid == RECHECK_WWID_ON && ++ (pp->bus != SYSFS_BUS_SCSI || pp->getuid != NULL || ++ !has_uid_fallback(pp))) { ++ pp->recheck_wwid = RECHECK_WWID_OFF; ++ origin = "(setting: unsupported by device type/config)"; ++ } ++ condlog(3, "%s: recheck_wwid = %i %s", pp->dev, pp->recheck_wwid, ++ origin); ++ return 0; ++} ++ + void + detect_prio(struct config *conf, struct path * pp) + { +diff --git a/libmultipath/propsel.h b/libmultipath/propsel.h +index a68bacf0..72a7e33c 100644 +--- a/libmultipath/propsel.h ++++ b/libmultipath/propsel.h +@@ -7,6 +7,7 @@ int select_features (struct config *conf, struct multipath * mp); + int select_hwhandler (struct config *conf, struct multipath * mp); + int select_checker(struct config *conf, struct path *pp); + int select_getuid (struct config *conf, struct path * pp); ++int select_recheck_wwid(struct config *conf, struct path * pp); + int select_prio (struct config *conf, struct path * pp); + int select_find_multipaths_timeout(struct config *conf, struct path *pp); + int select_no_path_retry(struct config *conf, struct multipath *mp); +diff --git a/libmultipath/structs.h b/libmultipath/structs.h +index d6ff6762..c8447e56 100644 +--- a/libmultipath/structs.h ++++ b/libmultipath/structs.h +@@ -242,6 +242,12 @@ enum eh_deadline_states { + EH_DEADLINE_ZERO = UOZ_ZERO, + }; + ++enum recheck_wwid_states { ++ RECHECK_WWID_UNDEF = YNU_UNDEF, ++ RECHECK_WWID_OFF = YNU_NO, ++ RECHECK_WWID_ON = YNU_YES, ++}; ++ + struct vpd_vendor_page { + int pg; + const char *name; +@@ -316,6 +322,7 @@ struct path { + int find_multipaths_timeout; + int marginal; + int vpd_vendor_id; ++ int recheck_wwid; + /* configlet pointers */ + vector hwe; + struct gen_path generic_path; +diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 +index 8ef3a747..37030765 100644 +--- a/multipath/multipath.conf.5 ++++ b/multipath/multipath.conf.5 +@@ -1273,6 +1273,20 @@ The default is: \fB\(dqNONE\(dq\fR + .RE + . + . ++.TP ++.B recheck_wwid ++If set to \fIyes\fR, when a failed path is restored, its wwid is rechecked. If ++the wwid has changed, the path is removed from the current multipath device, ++and re-added as a new path. Multipathd will also recheck a path's wwid if it is ++manually re-added. This option only works for SCSI devices that are configured ++to use the default uid_attribute, \fIID_SERIAL\fR, or sysfs for getting their ++wwid. ++.RS ++.TP ++The default is \fBno\fR ++.RE ++. ++. + + . + .\" ---------------------------------------------------------------------------- +diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c +index 54635738..7f3e61f6 100644 +--- a/multipathd/cli_handlers.c ++++ b/multipathd/cli_handlers.c +@@ -715,6 +715,15 @@ cli_add_path (void * v, char ** reply, int * len, void * data) + pp = find_path_by_dev(vecs->pathvec, param); + if (pp && pp->initialized != INIT_REMOVED) { + condlog(2, "%s: path already in pathvec", param); ++ ++ if (pp->recheck_wwid == RECHECK_WWID_ON && ++ check_path_wwid_change(pp)) { ++ condlog(0, "%s: wwid changed. Removing device", ++ pp->dev); ++ handle_path_wwid_change(pp, vecs); ++ return 1; ++ } ++ + if (pp->mpp) + return 0; + } else if (pp) { +diff --git a/multipathd/main.c b/multipathd/main.c +index 19679848..637a53bf 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -823,6 +823,73 @@ ev_remove_map (char * devname, char * alias, int minor, struct vectors * vecs) + return flush_map(mpp, vecs, 0); + } + ++static void ++rescan_path(struct udev_device *parent) ++{ ++ while(parent) { ++ const char *subsys = udev_device_get_subsystem(parent); ++ if (subsys && !strncmp(subsys, "scsi", 4)) ++ break; ++ parent = udev_device_get_parent(parent); ++ } ++ if (parent) ++ sysfs_attr_set_value(parent, "rescan", "1", strlen("1")); ++} ++ ++void ++handle_path_wwid_change(struct path *pp, struct vectors *vecs) ++{ ++ struct udev_device *udd; ++ ++ if (!pp || !pp->udev) ++ return; ++ ++ udd = udev_device_ref(pp->udev); ++ if (ev_remove_path(pp, vecs, 1) != 0 && pp->mpp) { ++ pp->dmstate = PSTATE_FAILED; ++ dm_fail_path(pp->mpp->alias, pp->dev_t); ++ } ++ rescan_path(udd); ++ sysfs_attr_set_value(udd, "uevent", "add", strlen("add")); ++ trigger_partitions_udev_change(udd, "add", strlen("add")); ++ udev_device_unref(udd); ++} ++ ++bool ++check_path_wwid_change(struct path *pp) ++{ ++ char wwid[WWID_SIZE]; ++ int len = 0; ++ size_t i; ++ ++ if (!strlen(pp->wwid)) ++ return false; ++ ++ /* Get the real fresh device wwid by sgio. sysfs still has old ++ * data, so only get_vpd_sgio will work to get the new wwid */ ++ len = get_vpd_sgio(pp->fd, 0x83, 0, wwid, WWID_SIZE); ++ ++ if (len <= 0) { ++ condlog(2, "%s: failed to check wwid by sgio: len = %d", ++ pp->dev, len); ++ return false; ++ } ++ ++ /*Strip any trailing blanks */ ++ for (i = strlen(pp->wwid); i > 0 && pp->wwid[i-1] == ' '; i--); ++ /* no-op */ ++ pp->wwid[i] = '\0'; ++ condlog(4, "%s: Got wwid %s by sgio", pp->dev, wwid); ++ ++ if (strncmp(wwid, pp->wwid, WWID_SIZE)) { ++ condlog(0, "%s: wwid '%s' doesn't match wwid '%s' from device", ++ pp->dev, pp->wwid, wwid); ++ return true; ++ } ++ ++ return false; ++} ++ + static int + uev_add_path (struct uevent *uev, struct vectors * vecs, int need_do_map) + { +@@ -1296,6 +1363,7 @@ uev_update_path (struct uevent *uev, struct vectors * vecs) + condlog(0, "%s: path wwid changed from '%s' to '%s'", + uev->kernel, wwid, pp->wwid); + ev_remove_path(pp, vecs, 1); ++ rescan_path(uev->udev); + needs_reinit = 1; + goto out; + } else { +@@ -2197,6 +2265,16 @@ check_path (struct vectors * vecs, struct path * pp, unsigned int ticks) + return 0; + set_no_path_retry(pp->mpp); + ++ if (pp->recheck_wwid == RECHECK_WWID_ON && ++ (newstate == PATH_UP || newstate == PATH_GHOST) && ++ ((pp->state != PATH_UP && pp->state != PATH_GHOST) || ++ pp->dmstate == PSTATE_FAILED) && ++ check_path_wwid_change(pp)) { ++ condlog(0, "%s: path wwid change detected. Removing", pp->dev); ++ handle_path_wwid_change(pp, vecs); ++ return 0; ++ } ++ + if ((newstate == PATH_UP || newstate == PATH_GHOST) && + (san_path_check_enabled(pp->mpp) || + marginal_path_check_enabled(pp->mpp))) { +diff --git a/multipathd/main.h b/multipathd/main.h +index 5abbe97b..ddd953f9 100644 +--- a/multipathd/main.h ++++ b/multipathd/main.h +@@ -50,4 +50,6 @@ int update_multipath (struct vectors *vecs, char *mapname, int reset); + int reload_and_sync_map(struct multipath *mpp, struct vectors *vecs, + int refresh); + ++void handle_path_wwid_change(struct path *pp, struct vectors *vecs); ++bool check_path_wwid_change(struct path *pp); + #endif /* MAIN_H */ diff --git a/0127-libmultipath-check-if-user_friendly_name-is-in-use.patch b/0127-libmultipath-check-if-user_friendly_name-is-in-use.patch new file mode 100644 index 0000000..770dc90 --- /dev/null +++ b/0127-libmultipath-check-if-user_friendly_name-is-in-use.patch @@ -0,0 +1,231 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 10 Mar 2021 15:15:14 -0600 +Subject: [PATCH] libmultipath: check if user_friendly_name is in use + +If there are multipath devices that have user_friendly_names but do not +have their bindings in the bindings_file, get_user_friendly_alias() can +currently give out those names again. This can result in an incorrect +entry in the bindings file, and a device that gets created with a WWID +alias instead of a user_friendly_name. This situation can happen after +the pivot root, if a multipath device is created in the initramfs. If +this device doesn't have a binding in the regular filesystem +bindings_file and a new multipath device is created before it can add +its binding, the new device can steal that user_friendly_name during +multipathd's initial configure. + +To solve this, get_user_friendly_alias() now calls lookup_binding() with +a new paramter, telling it to check if the id it found is already in use +by a diffent device. If so, lookup_binding() will continue to check open +ids, until it finds one that it not currently in use by a dm device. + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + libmultipath/alias.c | 48 +++++++++++++++++++++++++++++++++++++++++--- + tests/alias.c | 22 ++++++++++---------- + 2 files changed, 56 insertions(+), 14 deletions(-) + +diff --git a/libmultipath/alias.c b/libmultipath/alias.c +index a7ba485a..02bc9d65 100644 +--- a/libmultipath/alias.c ++++ b/libmultipath/alias.c +@@ -21,6 +21,7 @@ + #include "config.h" + #include "util.h" + #include "errno.h" ++#include "devmapper.h" + + + /* +@@ -119,6 +120,28 @@ scan_devname(const char *alias, const char *prefix) + return n; + } + ++static int ++id_already_taken(int id, const char *prefix, const char *map_wwid) ++{ ++ char alias[LINE_MAX]; ++ ++ if (format_devname(alias, id, LINE_MAX, prefix) < 0) ++ return 0; ++ ++ if (dm_map_present(alias)) { ++ char wwid[WWID_SIZE]; ++ ++ /* If both the name and the wwid match, then it's fine.*/ ++ if (dm_get_uuid(alias, wwid, sizeof(wwid)) == 0 && ++ strncmp(map_wwid, wwid, sizeof(wwid)) == 0) ++ return 0; ++ condlog(3, "%s: alias '%s' already taken, but not in bindings file. reselecting alias", map_wwid, alias); ++ return 1; ++ } ++ return 0; ++} ++ ++ + /* + * Returns: 0 if matching entry in WWIDs file found + * -1 if an error occurs +@@ -128,7 +151,7 @@ scan_devname(const char *alias, const char *prefix) + */ + static int + lookup_binding(FILE *f, const char *map_wwid, char **map_alias, +- const char *prefix) ++ const char *prefix, int check_if_taken) + { + char buf[LINE_MAX]; + unsigned int line_nr = 0; +@@ -183,12 +206,31 @@ lookup_binding(FILE *f, const char *map_wwid, char **map_alias, + return 0; + } + } ++ if (!prefix && check_if_taken) ++ id = -1; + if (id >= smallest_bigger_id) { + if (biggest_id < INT_MAX) + id = biggest_id + 1; + else + id = -1; + } ++ if (id > 0 && check_if_taken) { ++ while(id_already_taken(id, prefix, map_wwid)) { ++ if (id == INT_MAX) { ++ id = -1; ++ break; ++ } ++ id++; ++ if (id == smallest_bigger_id) { ++ if (biggest_id == INT_MAX) { ++ id = -1; ++ break; ++ } ++ if (biggest_id >= smallest_bigger_id) ++ id = biggest_id + 1; ++ } ++ } ++ } + if (id < 0) { + condlog(0, "no more available user_friendly_names"); + return -1; +@@ -331,7 +373,7 @@ use_existing_alias (const char *wwid, const char *file, const char *alias_old, + goto out; + } + +- id = lookup_binding(f, wwid, &alias, NULL); ++ id = lookup_binding(f, wwid, &alias, NULL, 0); + if (alias) { + condlog(3, "Use existing binding [%s] for WWID [%s]", + alias, wwid); +@@ -388,7 +430,7 @@ get_user_friendly_alias(const char *wwid, const char *file, const char *prefix, + return NULL; + } + +- id = lookup_binding(f, wwid, &alias, prefix); ++ id = lookup_binding(f, wwid, &alias, prefix, 1); + if (id < 0) { + fclose(f); + return NULL; +diff --git a/tests/alias.c b/tests/alias.c +index 5e0bfea3..344aba73 100644 +--- a/tests/alias.c ++++ b/tests/alias.c +@@ -357,7 +357,7 @@ static void lb_empty(void **state) + + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID0] in bindings file.\n"); +- rc = lookup_binding(NULL, "WWID0", &alias, NULL); ++ rc = lookup_binding(NULL, "WWID0", &alias, NULL, 0); + assert_int_equal(rc, 1); + assert_ptr_equal(alias, NULL); + } +@@ -370,7 +370,7 @@ static void lb_match_a(void **state) + will_return(__wrap_fgets, "MPATHa WWID0\n"); + expect_condlog(3, "Found matching wwid [WWID0] in bindings file." + " Setting alias to MPATHa\n"); +- rc = lookup_binding(NULL, "WWID0", &alias, "MPATH"); ++ rc = lookup_binding(NULL, "WWID0", &alias, "MPATH", 0); + assert_int_equal(rc, 0); + assert_ptr_not_equal(alias, NULL); + assert_string_equal(alias, "MPATHa"); +@@ -385,7 +385,7 @@ static void lb_nomatch_a(void **state) + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID1] in bindings file.\n"); +- rc = lookup_binding(NULL, "WWID1", &alias, "MPATH"); ++ rc = lookup_binding(NULL, "WWID1", &alias, "MPATH", 0); + assert_int_equal(rc, 2); + assert_ptr_equal(alias, NULL); + } +@@ -399,7 +399,7 @@ static void lb_match_c(void **state) + will_return(__wrap_fgets, "MPATHc WWID1\n"); + expect_condlog(3, "Found matching wwid [WWID1] in bindings file." + " Setting alias to MPATHc\n"); +- rc = lookup_binding(NULL, "WWID1", &alias, "MPATH"); ++ rc = lookup_binding(NULL, "WWID1", &alias, "MPATH", 0); + assert_int_equal(rc, 0); + assert_ptr_not_equal(alias, NULL); + assert_string_equal(alias, "MPATHc"); +@@ -415,7 +415,7 @@ static void lb_nomatch_a_c(void **state) + will_return(__wrap_fgets, "MPATHc WWID1\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); +- rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 0); + assert_int_equal(rc, 2); + assert_ptr_equal(alias, NULL); + } +@@ -429,7 +429,7 @@ static void lb_nomatch_c_a(void **state) + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); +- rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 0); + assert_int_equal(rc, 2); + assert_ptr_equal(alias, NULL); + } +@@ -444,7 +444,7 @@ static void lb_nomatch_a_b(void **state) + will_return(__wrap_fgets, "MPATHb WWID1\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); +- rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 0); + assert_int_equal(rc, 3); + assert_ptr_equal(alias, NULL); + } +@@ -460,7 +460,7 @@ static void lb_nomatch_a_b_bad(void **state) + will_return(__wrap_fgets, NULL); + expect_condlog(3, "Ignoring malformed line 3 in bindings file\n"); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); +- rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 0); + assert_int_equal(rc, 3); + assert_ptr_equal(alias, NULL); + } +@@ -475,7 +475,7 @@ static void lb_nomatch_b_a(void **state) + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); +- rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 0); + assert_int_equal(rc, 27); + assert_ptr_equal(alias, NULL); + } +@@ -491,7 +491,7 @@ static void lb_nomatch_int_max(void **state) + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(0, "no more available user_friendly_names\n"); +- rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 0); + assert_int_equal(rc, -1); + assert_ptr_equal(alias, NULL); + } +@@ -506,7 +506,7 @@ static void lb_nomatch_int_max_m1(void **state) + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); +- rc = lookup_binding(NULL, "WWID2", &alias, "MPATH"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 0); + assert_int_equal(rc, INT_MAX); + assert_ptr_equal(alias, NULL); + } diff --git a/0128-tests-add-tests-for-checking-if-alias-is-in-use.patch b/0128-tests-add-tests-for-checking-if-alias-is-in-use.patch new file mode 100644 index 0000000..9849282 --- /dev/null +++ b/0128-tests-add-tests-for-checking-if-alias-is-in-use.patch @@ -0,0 +1,525 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 10 Mar 2021 15:15:15 -0600 +Subject: [PATCH] tests: add tests for checking if alias is in use + +Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck +--- + tests/alias.c | 409 +++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 405 insertions(+), 4 deletions(-) + +diff --git a/tests/alias.c b/tests/alias.c +index 344aba73..ebe1209e 100644 +--- a/tests/alias.c ++++ b/tests/alias.c +@@ -62,6 +62,25 @@ int __wrap_ftruncate(int fd, off_t length) + return __set_errno(mock_type(int)); + } + ++int __wrap_dm_map_present(const char * str) ++{ ++ check_expected(str); ++ return mock_type(int); ++} ++ ++int __wrap_dm_get_uuid(const char *name, char *uuid, int uuid_len) ++{ ++ int ret; ++ ++ check_expected(name); ++ check_expected(uuid_len); ++ assert_non_null(uuid); ++ ret = mock_type(int); ++ if (ret == 0) ++ strcpy(uuid, mock_ptr_type(char *)); ++ return ret; ++} ++ + static void fd_mpatha(void **state) + { + char buf[32]; +@@ -350,6 +369,45 @@ static int test_scan_devname(void) + return cmocka_run_group_tests(tests, NULL, NULL); + } + ++static void mock_unused_alias(const char *alias) ++{ ++ expect_string(__wrap_dm_map_present, str, alias); ++ will_return(__wrap_dm_map_present, 0); ++} ++ ++static void mock_self_alias(const char *alias, const char *wwid) ++{ ++ expect_string(__wrap_dm_map_present, str, alias); ++ will_return(__wrap_dm_map_present, 1); ++ expect_string(__wrap_dm_get_uuid, name, alias); ++ expect_value(__wrap_dm_get_uuid, uuid_len, WWID_SIZE); ++ will_return(__wrap_dm_get_uuid, 0); ++ will_return(__wrap_dm_get_uuid, wwid); ++} ++ ++#define USED_STR(alias_str, wwid_str) wwid_str ": alias '" alias_str "' already taken, but not in bindings file. reselecting alias\n" ++ ++static void mock_failed_alias(const char *alias, char *msg) ++{ ++ expect_string(__wrap_dm_map_present, str, alias); ++ will_return(__wrap_dm_map_present, 1); ++ expect_string(__wrap_dm_get_uuid, name, alias); ++ expect_value(__wrap_dm_get_uuid, uuid_len, WWID_SIZE); ++ will_return(__wrap_dm_get_uuid, 1); ++ expect_condlog(3, msg); ++} ++ ++static void mock_used_alias(const char *alias, char *msg) ++{ ++ expect_string(__wrap_dm_map_present, str, alias); ++ will_return(__wrap_dm_map_present, 1); ++ expect_string(__wrap_dm_get_uuid, name, alias); ++ expect_value(__wrap_dm_get_uuid, uuid_len, WWID_SIZE); ++ will_return(__wrap_dm_get_uuid, 0); ++ will_return(__wrap_dm_get_uuid, "WWID_USED"); ++ expect_condlog(3, msg); ++} ++ + static void lb_empty(void **state) + { + int rc; +@@ -362,6 +420,65 @@ static void lb_empty(void **state) + assert_ptr_equal(alias, NULL); + } + ++static void lb_empty_unused(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, NULL); ++ mock_unused_alias("MPATHa"); ++ expect_condlog(3, "No matching wwid [WWID0] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID0", &alias, "MPATH", 1); ++ assert_int_equal(rc, 1); ++ assert_ptr_equal(alias, NULL); ++ free(alias); ++} ++ ++static void lb_empty_failed(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, NULL); ++ mock_failed_alias("MPATHa", USED_STR("MPATHa", "WWID0")); ++ mock_unused_alias("MPATHb"); ++ expect_condlog(3, "No matching wwid [WWID0] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID0", &alias, "MPATH", 1); ++ assert_int_equal(rc, 2); ++ assert_ptr_equal(alias, NULL); ++ free(alias); ++} ++ ++static void lb_empty_1_used(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHa", USED_STR("MPATHa", "WWID0")); ++ mock_unused_alias("MPATHb"); ++ expect_condlog(3, "No matching wwid [WWID0] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID0", &alias, "MPATH", 1); ++ assert_int_equal(rc, 2); ++ assert_ptr_equal(alias, NULL); ++ free(alias); ++} ++ ++static void lb_empty_1_used_self(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHa", USED_STR("MPATHa", "WWID0")); ++ mock_self_alias("MPATHb", "WWID0"); ++ expect_condlog(3, "No matching wwid [WWID0] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID0", &alias, "MPATH", 1); ++ assert_int_equal(rc, 2); ++ assert_ptr_equal(alias, NULL); ++ free(alias); ++} ++ + static void lb_match_a(void **state) + { + int rc; +@@ -390,7 +507,52 @@ static void lb_nomatch_a(void **state) + assert_ptr_equal(alias, NULL); + } + +-static void lb_match_c(void **state) ++static void lb_nomatch_a_bad_check(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, NULL); ++ expect_condlog(0, "no more available user_friendly_names\n"); ++ rc = lookup_binding(NULL, "WWID1", &alias, NULL, 1); ++ assert_int_equal(rc, -1); ++ assert_ptr_equal(alias, NULL); ++} ++ ++static void lb_nomatch_a_unused(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_unused_alias("MPATHb"); ++ expect_condlog(3, "No matching wwid [WWID1] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID1", &alias, "MPATH", 1); ++ assert_int_equal(rc, 2); ++ assert_ptr_equal(alias, NULL); ++} ++ ++static void lb_nomatch_a_3_used_failed_self(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHb", USED_STR("MPATHb", "WWID1")); ++ mock_used_alias("MPATHc", USED_STR("MPATHc", "WWID1")); ++ mock_used_alias("MPATHd", USED_STR("MPATHd", "WWID1")); ++ mock_failed_alias("MPATHe", USED_STR("MPATHe", "WWID1")); ++ mock_self_alias("MPATHf", "WWID1"); ++ expect_condlog(3, "No matching wwid [WWID1] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID1", &alias, "MPATH", 1); ++ assert_int_equal(rc, 6); ++ assert_ptr_equal(alias, NULL); ++} ++ ++static void do_lb_match_c(void **state, int check_if_taken) + { + int rc; + char *alias; +@@ -399,13 +561,23 @@ static void lb_match_c(void **state) + will_return(__wrap_fgets, "MPATHc WWID1\n"); + expect_condlog(3, "Found matching wwid [WWID1] in bindings file." + " Setting alias to MPATHc\n"); +- rc = lookup_binding(NULL, "WWID1", &alias, "MPATH", 0); ++ rc = lookup_binding(NULL, "WWID1", &alias, "MPATH", check_if_taken); + assert_int_equal(rc, 0); + assert_ptr_not_equal(alias, NULL); + assert_string_equal(alias, "MPATHc"); + free(alias); + } + ++static void lb_match_c(void **state) ++{ ++ do_lb_match_c(state, 0); ++} ++ ++static void lb_match_c_check(void **state) ++{ ++ do_lb_match_c(state, 1); ++} ++ + static void lb_nomatch_a_c(void **state) + { + int rc; +@@ -420,6 +592,72 @@ static void lb_nomatch_a_c(void **state) + assert_ptr_equal(alias, NULL); + } + ++static void lb_nomatch_a_d_unused(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, "MPATHd WWID1\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_unused_alias("MPATHb"); ++ expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, 2); ++ assert_ptr_equal(alias, NULL); ++} ++ ++static void lb_nomatch_a_d_1_used(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, "MPATHd WWID1\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHb", USED_STR("MPATHb", "WWID2")); ++ mock_unused_alias("MPATHc"); ++ expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, 3); ++ assert_ptr_equal(alias, NULL); ++} ++ ++static void lb_nomatch_a_d_2_used(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, "MPATHd WWID1\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHb", USED_STR("MPATHb", "WWID2")); ++ mock_used_alias("MPATHc", USED_STR("MPATHc", "WWID2")); ++ mock_unused_alias("MPATHe"); ++ expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, 5); ++ assert_ptr_equal(alias, NULL); ++} ++ ++static void lb_nomatch_a_d_3_used(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, "MPATHd WWID1\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHb", USED_STR("MPATHb", "WWID2")); ++ mock_used_alias("MPATHc", USED_STR("MPATHc", "WWID2")); ++ mock_used_alias("MPATHe", USED_STR("MPATHe", "WWID2")); ++ mock_unused_alias("MPATHf"); ++ expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, 6); ++ assert_ptr_equal(alias, NULL); ++} ++ + static void lb_nomatch_c_a(void **state) + { + int rc; +@@ -434,6 +672,39 @@ static void lb_nomatch_c_a(void **state) + assert_ptr_equal(alias, NULL); + } + ++static void lb_nomatch_d_a_unused(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHc WWID1\n"); ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, "MPATHd WWID0\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_unused_alias("MPATHb"); ++ expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, 2); ++ assert_ptr_equal(alias, NULL); ++} ++ ++static void lb_nomatch_d_a_1_used(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHc WWID1\n"); ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, "MPATHd WWID0\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHb", USED_STR("MPATHb", "WWID2")); ++ mock_unused_alias("MPATHe"); ++ expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, 5); ++ assert_ptr_equal(alias, NULL); ++} ++ + static void lb_nomatch_a_b(void **state) + { + int rc; +@@ -465,6 +736,23 @@ static void lb_nomatch_a_b_bad(void **state) + assert_ptr_equal(alias, NULL); + } + ++static void lb_nomatch_a_b_bad_self(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, "MPATHz WWID26\n"); ++ will_return(__wrap_fgets, "MPATHb\n"); ++ will_return(__wrap_fgets, NULL); ++ expect_condlog(3, "Ignoring malformed line 3 in bindings file\n"); ++ mock_self_alias("MPATHc", "WWID2"); ++ expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, 3); ++ assert_ptr_equal(alias, NULL); ++} ++ + static void lb_nomatch_b_a(void **state) + { + int rc; +@@ -480,8 +768,27 @@ static void lb_nomatch_b_a(void **state) + assert_ptr_equal(alias, NULL); + } + ++static void lb_nomatch_b_a_3_used(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHb WWID1\n"); ++ will_return(__wrap_fgets, "MPATHz WWID26\n"); ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHaa", USED_STR("MPATHaa", "WWID2")); ++ mock_used_alias("MPATHab", USED_STR("MPATHab", "WWID2")); ++ mock_used_alias("MPATHac", USED_STR("MPATHac", "WWID2")); ++ mock_unused_alias("MPATHad"); ++ expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, 30); ++ assert_ptr_equal(alias, NULL); ++} ++ + #ifdef MPATH_ID_INT_MAX +-static void lb_nomatch_int_max(void **state) ++static void do_lb_nomatch_int_max(void **state, int check_if_taken) + { + int rc; + char *alias; +@@ -491,7 +798,32 @@ static void lb_nomatch_int_max(void **state) + will_return(__wrap_fgets, "MPATHa WWID0\n"); + will_return(__wrap_fgets, NULL); + expect_condlog(0, "no more available user_friendly_names\n"); +- rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 0); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", check_if_taken); ++ assert_int_equal(rc, -1); ++ assert_ptr_equal(alias, NULL); ++} ++ ++static void lb_nomatch_int_max(void **state) ++{ ++ do_lb_nomatch_int_max(state, 0); ++} ++ ++static void lb_nomatch_int_max_check(void **state) ++{ ++ do_lb_nomatch_int_max(state, 1); ++} ++ ++static void lb_nomatch_int_max_used(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHb WWID1\n"); ++ will_return(__wrap_fgets, "MPATH" MPATH_ID_INT_MAX " WWIDMAX\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHa", USED_STR("MPATHa", "WWID2")); ++ expect_condlog(0, "no more available user_friendly_names\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); + assert_int_equal(rc, -1); + assert_ptr_equal(alias, NULL); + } +@@ -510,23 +842,92 @@ static void lb_nomatch_int_max_m1(void **state) + assert_int_equal(rc, INT_MAX); + assert_ptr_equal(alias, NULL); + } ++ ++static void lb_nomatch_int_max_m1_used(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHb WWID1\n"); ++ will_return(__wrap_fgets, "MPATH" MPATH_ID_INT_MAX_m1 " WWIDMAX\n"); ++ will_return(__wrap_fgets, "MPATHa WWID0\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATH" MPATH_ID_INT_MAX, USED_STR("MPATH" MPATH_ID_INT_MAX, "WWID2")); ++ expect_condlog(0, "no more available user_friendly_names\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, -1); ++ assert_ptr_equal(alias, NULL); ++} ++ ++static void lb_nomatch_int_max_m1_1_used(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHb WWID1\n"); ++ will_return(__wrap_fgets, "MPATH" MPATH_ID_INT_MAX_m1 " WWIDMAX\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHa", USED_STR("MPATHa", "WWID2")); ++ mock_unused_alias("MPATH" MPATH_ID_INT_MAX); ++ expect_condlog(3, "No matching wwid [WWID2] in bindings file.\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, INT_MAX); ++ assert_ptr_equal(alias, NULL); ++} ++ ++static void lb_nomatch_int_max_m1_2_used(void **state) ++{ ++ int rc; ++ char *alias; ++ ++ will_return(__wrap_fgets, "MPATHb WWID1\n"); ++ will_return(__wrap_fgets, "MPATH" MPATH_ID_INT_MAX_m1 " WWIDMAX\n"); ++ will_return(__wrap_fgets, NULL); ++ mock_used_alias("MPATHa", USED_STR("MPATHa", "WWID2")); ++ mock_used_alias("MPATH" MPATH_ID_INT_MAX, USED_STR("MPATH" MPATH_ID_INT_MAX, "WWID2")); ++ expect_condlog(0, "no more available user_friendly_names\n"); ++ rc = lookup_binding(NULL, "WWID2", &alias, "MPATH", 1); ++ assert_int_equal(rc, -1); ++ assert_ptr_equal(alias, NULL); ++} + #endif + + static int test_lookup_binding(void) + { + const struct CMUnitTest tests[] = { + cmocka_unit_test(lb_empty), ++ cmocka_unit_test(lb_empty_unused), ++ cmocka_unit_test(lb_empty_failed), ++ cmocka_unit_test(lb_empty_1_used), ++ cmocka_unit_test(lb_empty_1_used_self), + cmocka_unit_test(lb_match_a), + cmocka_unit_test(lb_nomatch_a), ++ cmocka_unit_test(lb_nomatch_a_bad_check), ++ cmocka_unit_test(lb_nomatch_a_unused), ++ cmocka_unit_test(lb_nomatch_a_3_used_failed_self), + cmocka_unit_test(lb_match_c), ++ cmocka_unit_test(lb_match_c_check), + cmocka_unit_test(lb_nomatch_a_c), ++ cmocka_unit_test(lb_nomatch_a_d_unused), ++ cmocka_unit_test(lb_nomatch_a_d_1_used), ++ cmocka_unit_test(lb_nomatch_a_d_2_used), ++ cmocka_unit_test(lb_nomatch_a_d_3_used), + cmocka_unit_test(lb_nomatch_c_a), ++ cmocka_unit_test(lb_nomatch_d_a_unused), ++ cmocka_unit_test(lb_nomatch_d_a_1_used), + cmocka_unit_test(lb_nomatch_a_b), + cmocka_unit_test(lb_nomatch_a_b_bad), ++ cmocka_unit_test(lb_nomatch_a_b_bad_self), + cmocka_unit_test(lb_nomatch_b_a), ++ cmocka_unit_test(lb_nomatch_b_a_3_used), + #ifdef MPATH_ID_INT_MAX + cmocka_unit_test(lb_nomatch_int_max), ++ cmocka_unit_test(lb_nomatch_int_max_check), ++ cmocka_unit_test(lb_nomatch_int_max_used), + cmocka_unit_test(lb_nomatch_int_max_m1), ++ cmocka_unit_test(lb_nomatch_int_max_m1_used), ++ cmocka_unit_test(lb_nomatch_int_max_m1_1_used), ++ cmocka_unit_test(lb_nomatch_int_max_m1_2_used), + #endif + }; + diff --git a/0129-multipath-tools-add-DellEMC-PowerStore-to-hardware-t.patch b/0129-multipath-tools-add-DellEMC-PowerStore-to-hardware-t.patch new file mode 100644 index 0000000..596527f --- /dev/null +++ b/0129-multipath-tools-add-DellEMC-PowerStore-to-hardware-t.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Xose Vazquez Perez +Date: Sat, 6 Mar 2021 03:54:15 +0100 +Subject: [PATCH] multipath-tools: add DellEMC/PowerStore to hardware table + +Info from: https://www.delltechnologies.com/en-us/collaterals/unauth/technical-guides-support-information/products/storage-2/docu5128.pdf + +Cc: Martin Wilck +Cc: Benjamin Marzinski +Cc: Christophe Varoqui +Cc: DM-DEVEL ML +Signed-off-by: Xose Vazquez Perez +Reviewed-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + libmultipath/hwtable.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/libmultipath/hwtable.c b/libmultipath/hwtable.c +index 921aadc5..58fa7387 100644 +--- a/libmultipath/hwtable.c ++++ b/libmultipath/hwtable.c +@@ -388,6 +388,17 @@ static struct hwentry default_hw[] = { + .product = "^EMC PowerMax_", + .pgpolicy = MULTIBUS, + }, ++ { ++ /* PowerStore */ ++ .vendor = "DellEMC", ++ .product = "PowerStore", ++ .pgpolicy = GROUP_BY_PRIO, ++ .prio_name = PRIO_ALUA, ++ .hwhandler = "1 alua", ++ .pgfailback = -FAILBACK_IMMEDIATE, ++ .no_path_retry = 3, ++ .fast_io_fail = 15, ++ }, + /* + * Fujitsu + */ diff --git a/0130-multipath-tools-delete-a-space-in-multipath.conf.5-t.patch b/0130-multipath-tools-delete-a-space-in-multipath.conf.5-t.patch new file mode 100644 index 0000000..c8c8d1e --- /dev/null +++ b/0130-multipath-tools-delete-a-space-in-multipath.conf.5-t.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Xose Vazquez Perez +Date: Sat, 6 Mar 2021 16:39:59 +0100 +Subject: [PATCH] multipath-tools: delete a space in multipath.conf.5 to be + consistent + +Cc: Martin Wilck +Cc: Benjamin Marzinski +Cc: Christophe Varoqui +Cc: DM-DEVEL ML +Signed-off-by: Xose Vazquez Perez +Reviewed-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + multipath/multipath.conf.5 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 +index 37030765..73977b97 100644 +--- a/multipath/multipath.conf.5 ++++ b/multipath/multipath.conf.5 +@@ -1095,7 +1095,7 @@ for the configured time, and is declared healthy, it will be returned to its + normal pathgroup. See "Shaky paths detection" below for more information. + .RS + .TP +-The default is: \fBno\fR ++The default is: \fBno\fR + .RE + . + . diff --git a/0131-multipath-tools-tests-allow-control-of-test-verbosit.patch b/0131-multipath-tools-tests-allow-control-of-test-verbosit.patch new file mode 100644 index 0000000..50da56b --- /dev/null +++ b/0131-multipath-tools-tests-allow-control-of-test-verbosit.patch @@ -0,0 +1,253 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 11 Feb 2021 22:52:39 +0100 +Subject: [PATCH] multipath-tools tests: allow control of test verbosity + +Use common code to control verbosity during unit tests runs. +The environment variable MPATHTEST_VERBOSITY is honored by most +tests, except those that need to parse the log messages or have +other special needs. + +Also, get rid of the now obsolete global variables logsink and +udev, as these are now defined in libmultipath. + +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + tests/README.md | 5 +++++ + tests/alias.c | 2 +- + tests/blacklist.c | 2 +- + tests/devt.c | 1 + + tests/directio.c | 2 +- + tests/dmevents.c | 1 + + tests/globals.c | 27 +++++++++++++++++++++------ + tests/hwtable.c | 2 ++ + tests/parser.c | 1 + + tests/pgpolicy.c | 1 + + tests/uevent.c | 1 + + tests/unaligned.c | 1 + + tests/util.c | 1 + + tests/valid.c | 2 ++ + tests/vpd.c | 1 + + 15 files changed, 41 insertions(+), 9 deletions(-) + +diff --git a/tests/README.md b/tests/README.md +index 6e7ad405..47c0f0b2 100644 +--- a/tests/README.md ++++ b/tests/README.md +@@ -13,6 +13,11 @@ If valgrind detects a bad memory access or leak, the test will fail. The + output of the test run, including valgrind output, is stored as + `.vgr`. + ++## Controlling verbosity for unit tests ++ ++Some test programs use the environment variable `MPATHTEST_VERBOSITY` to ++control the log level during test execution. ++ + ## Notes on individual tests + + ### Tests that require root permissions +diff --git a/tests/alias.c b/tests/alias.c +index ebe1209e..7e7c1878 100644 +--- a/tests/alias.c ++++ b/tests/alias.c +@@ -1137,7 +1137,7 @@ static int test_allocate_binding(void) + int main(void) + { + int ret = 0; +- libmp_verbosity = conf.verbosity; ++ init_test_verbosity(3); + + ret += test_format_devname(); + ret += test_scan_devname(); +diff --git a/tests/blacklist.c b/tests/blacklist.c +index 0b42e255..882aa3a1 100644 +--- a/tests/blacklist.c ++++ b/tests/blacklist.c +@@ -153,7 +153,7 @@ static int setup(void **state) + store_ble(blist_property_wwn_inv, "!ID_WWN", ORIGIN_CONFIG)) + return -1; + +- libmp_verbosity = conf.verbosity = 4; ++ init_test_verbosity(4); + return 0; + } + +diff --git a/tests/devt.c b/tests/devt.c +index fd4d74a3..2b728516 100644 +--- a/tests/devt.c ++++ b/tests/devt.c +@@ -187,6 +187,7 @@ int main(void) + { + int ret = 0; + ++ init_test_verbosity(-1); + ret += devt2devname_tests(); + return ret; + } +diff --git a/tests/directio.c b/tests/directio.c +index 98954099..9f7d3883 100644 +--- a/tests/directio.c ++++ b/tests/directio.c +@@ -770,7 +770,7 @@ int main(void) + { + int ret = 0; + +- conf.verbosity = 2; ++ init_test_verbosity(2); + ret += test_directio(); + return ret; + } +diff --git a/tests/dmevents.c b/tests/dmevents.c +index 29eaa6db..204cf1d9 100644 +--- a/tests/dmevents.c ++++ b/tests/dmevents.c +@@ -925,6 +925,7 @@ int main(void) + { + int ret = 0; + ++ init_test_verbosity(-1); + ret += test_dmevents(); + return ret; + } +diff --git a/tests/globals.c b/tests/globals.c +index fc0c07ad..36319ed3 100644 +--- a/tests/globals.c ++++ b/tests/globals.c +@@ -1,13 +1,12 @@ ++#include ++#include ++ ++#include "defaults.h" + #include "structs.h" + #include "config.h" + #include "debug.h" + +-/* Required globals */ +-struct udev *udev; +-int logsink = LOGSINK_STDERR_WITHOUT_TIME; +-struct config conf = { +- .verbosity = 4, +-}; ++struct config conf; + + struct config *get_multipath_config(void) + { +@@ -16,3 +15,19 @@ struct config *get_multipath_config(void) + + void put_multipath_config(void *arg) + {} ++ ++static __attribute__((unused)) void init_test_verbosity(int test_verbosity) ++{ ++ char *verb = getenv("MPATHTEST_VERBOSITY"); ++ ++ libmp_verbosity = test_verbosity >= 0 ? test_verbosity : ++ DEFAULT_VERBOSITY; ++ if (verb && *verb) { ++ char *c; ++ int vb; ++ ++ vb = strtoul(verb, &c, 10); ++ if (!*c && vb >= 0 && vb <= 5) ++ libmp_verbosity = vb; ++ } ++} +diff --git a/tests/hwtable.c b/tests/hwtable.c +index 4dd0873b..6f5766f7 100644 +--- a/tests/hwtable.c ++++ b/tests/hwtable.c +@@ -1778,6 +1778,8 @@ int main(void) + { + int ret = 0; + ++ /* We can't use init_test_verbosity in this test */ ++ libmp_verbosity = VERBOSITY; + ret += test_hwtable(); + return ret; + } +diff --git a/tests/parser.c b/tests/parser.c +index 5772391e..cf96d81f 100644 +--- a/tests/parser.c ++++ b/tests/parser.c +@@ -511,6 +511,7 @@ int main(void) + { + int ret = 0; + ++ init_test_verbosity(-1); + ret += test_config_parser(); + return ret; + } +diff --git a/tests/pgpolicy.c b/tests/pgpolicy.c +index 3f61b123..57ad3381 100644 +--- a/tests/pgpolicy.c ++++ b/tests/pgpolicy.c +@@ -1031,6 +1031,7 @@ int main(void) + { + int ret = 0; + ++ init_test_verbosity(-1); + ret += test_pgpolicies(); + return ret; + } +diff --git a/tests/uevent.c b/tests/uevent.c +index 9ffcd2df..648ff268 100644 +--- a/tests/uevent.c ++++ b/tests/uevent.c +@@ -322,6 +322,7 @@ int main(void) + { + int ret = 0; + ++ init_test_verbosity(-1); + ret += test_uevent_get_XXX(); + return ret; + } +diff --git a/tests/unaligned.c b/tests/unaligned.c +index 7ece1de8..e43b64d4 100644 +--- a/tests/unaligned.c ++++ b/tests/unaligned.c +@@ -91,6 +91,7 @@ int main(void) + { + int ret = 0; + ++ init_test_verbosity(-1); + ret += test_unaligned(); + return ret; + } +diff --git a/tests/util.c b/tests/util.c +index c3c49b60..9affb0e1 100644 +--- a/tests/util.c ++++ b/tests/util.c +@@ -946,6 +946,7 @@ int main(void) + { + int ret = 0; + ++ init_test_verbosity(-1); + ret += test_basenamecpy(); + ret += test_bitmasks(); + ret += test_strlcpy(); +diff --git a/tests/valid.c b/tests/valid.c +index 8ec803e8..e7393a1c 100644 +--- a/tests/valid.c ++++ b/tests/valid.c +@@ -554,6 +554,8 @@ int test_valid(void) + int main(void) + { + int ret = 0; ++ ++ init_test_verbosity(-1); + ret += test_valid(); + return ret; + } +diff --git a/tests/vpd.c b/tests/vpd.c +index e2ec65e9..8e730d37 100644 +--- a/tests/vpd.c ++++ b/tests/vpd.c +@@ -799,6 +799,7 @@ int main(void) + { + int ret = 0; + ++ init_test_verbosity(-1); + ret += test_vpd(); + return ret; + } diff --git a/0132-multipath-tools-devt-test-avoid-failure-when-run-in-.patch b/0132-multipath-tools-devt-test-avoid-failure-when-run-in-.patch new file mode 100644 index 0000000..35ea98d --- /dev/null +++ b/0132-multipath-tools-devt-test-avoid-failure-when-run-in-.patch @@ -0,0 +1,63 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 11 Feb 2021 22:54:58 +0100 +Subject: [PATCH] multipath-tools: devt test: avoid failure when run in + containers + +/sys/dev/block is usually unavailable containers, causing libudev +calls to fail. Skip the respective tests. + +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + tests/devt.c | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) + +diff --git a/tests/devt.c b/tests/devt.c +index 2b728516..02f2e8f3 100644 +--- a/tests/devt.c ++++ b/tests/devt.c +@@ -11,11 +11,25 @@ + #include + #include + #include ++#include ++#include ++#include + #include "util.h" + #include "debug.h" + + #include "globals.c" + ++static bool sys_dev_block_exists(void) ++{ ++ int fd; ++ bool rc; ++ ++ fd = open("/sys/dev/block", O_RDONLY|O_DIRECTORY); ++ rc = (fd != -1); ++ close(fd); ++ return rc; ++} ++ + static int get_one_devt(char *devt, size_t len) + { + struct udev_enumerate *enm; +@@ -71,6 +85,8 @@ static void test_devt2devname_devt_good(void **state) + { + char dummy[BLK_DEV_SIZE]; + ++ if (!sys_dev_block_exists()) ++ skip(); + assert_int_equal(devt2devname(dummy, sizeof(dummy), *state), 0); + } + +@@ -137,6 +153,8 @@ static void test_devt2devname_real(void **state) + struct udev_list_entry *first, *item; + unsigned int i = 0; + ++ if (!sys_dev_block_exists()) ++ skip(); + enm = udev_enumerate_new(udev); + assert_non_null(enm); + r = udev_enumerate_add_match_subsystem(enm, "block"); diff --git a/0133-multipath-tools-fix-compilation-errors-on-32-bit-mus.patch b/0133-multipath-tools-fix-compilation-errors-on-32-bit-mus.patch new file mode 100644 index 0000000..36a7607 --- /dev/null +++ b/0133-multipath-tools-fix-compilation-errors-on-32-bit-mus.patch @@ -0,0 +1,96 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 12 Feb 2021 00:38:44 +0100 +Subject: [PATCH] multipath-tools: fix compilation errors on 32-bit musl + +gcc on alpine Linux/i386 throws errors because the "tv_sec" element +of struct timespec is a time_t, which is a "long long" in that +environment. In general, time_t is signed. As we only use CLOCK_MONOTONIC, +which starts at boot time, a cast to long should be no problem, even +in 32bit environments. + +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/main.c | 2 +- + multipathd/main.c | 16 ++++++++-------- + multipathd/uxlsnr.c | 4 ++-- + 3 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/multipath/main.c b/multipath/main.c +index 9ac42869..3f97582b 100644 +--- a/multipath/main.c ++++ b/multipath/main.c +@@ -417,7 +417,7 @@ static int print_cmd_valid(int k, const vector pathvec, + wait = find_multipaths_check_timeout(pp, 0, &until); + if (wait == FIND_MULTIPATHS_WAITING) + printf("FIND_MULTIPATHS_WAIT_UNTIL=\"%ld.%06ld\"\n", +- until.tv_sec, until.tv_nsec/1000); ++ (long)until.tv_sec, until.tv_nsec/1000); + else if (wait == FIND_MULTIPATHS_WAIT_DONE) + printf("FIND_MULTIPATHS_WAIT_UNTIL=\"0\"\n"); + printf("DM_MULTIPATH_DEVICE_PATH=\"%d\"\n", +diff --git a/multipathd/main.c b/multipathd/main.c +index 637a53bf..e0797ccd 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -2486,8 +2486,8 @@ checkerloop (void *ap) + get_monotonic_time(&start_time); + if (start_time.tv_sec && last_time.tv_sec) { + timespecsub(&start_time, &last_time, &diff_time); +- condlog(4, "tick (%lu.%06lu secs)", +- diff_time.tv_sec, diff_time.tv_nsec / 1000); ++ condlog(4, "tick (%ld.%06lu secs)", ++ (long)diff_time.tv_sec, diff_time.tv_nsec / 1000); + last_time = start_time; + ticks = diff_time.tv_sec; + } else { +@@ -2548,18 +2548,18 @@ checkerloop (void *ap) + if (num_paths) { + unsigned int max_checkint; + +- condlog(4, "checked %d path%s in %lu.%06lu secs", ++ condlog(4, "checked %d path%s in %ld.%06lu secs", + num_paths, num_paths > 1 ? "s" : "", +- diff_time.tv_sec, ++ (long)diff_time.tv_sec, + diff_time.tv_nsec / 1000); + conf = get_multipath_config(); + max_checkint = conf->max_checkint; + put_multipath_config(conf); + if (diff_time.tv_sec > (time_t)max_checkint) + condlog(1, "path checkers took longer " +- "than %lu seconds, consider " ++ "than %ld seconds, consider " + "increasing max_polling_interval", +- diff_time.tv_sec); ++ (long)diff_time.tv_sec); + } + } + +@@ -2585,8 +2585,8 @@ checkerloop (void *ap) + } else + diff_time.tv_sec = 1; + +- condlog(3, "waiting for %lu.%06lu secs", +- diff_time.tv_sec, ++ condlog(3, "waiting for %ld.%06lu secs", ++ (long)diff_time.tv_sec, + diff_time.tv_nsec / 1000); + if (nanosleep(&diff_time, NULL) != 0) { + condlog(3, "nanosleep failed with error %d", +diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c +index cd462b6d..dbee0d6f 100644 +--- a/multipathd/uxlsnr.c ++++ b/multipathd/uxlsnr.c +@@ -154,8 +154,8 @@ static void check_timeout(struct timespec start_time, char *inbuf, + diff_time.tv_nsec / (1000 * 1000); + if (msecs > timeout) + condlog(2, "cli cmd '%s' timeout reached " +- "after %lu.%06lu secs", inbuf, +- diff_time.tv_sec, diff_time.tv_nsec / 1000); ++ "after %ld.%06lu secs", inbuf, ++ (long)diff_time.tv_sec, diff_time.tv_nsec / 1000); + } + } + diff --git a/0134-libmultipath-fix-compilation-error-with-gcc-10-on-i3.patch b/0134-libmultipath-fix-compilation-error-with-gcc-10-on-i3.patch new file mode 100644 index 0000000..dff5288 --- /dev/null +++ b/0134-libmultipath-fix-compilation-error-with-gcc-10-on-i3.patch @@ -0,0 +1,58 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 12 Feb 2021 00:41:55 +0100 +Subject: [PATCH] libmultipath: fix compilation error with gcc 10 on i386 + +gcc complained about a possible negative value of "nr" in the +memcpy() call. I consider that a false positive, but it's easily +fixed. + +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmultipath/sysfs.c | 29 ++++++++++++++--------------- + 1 file changed, 14 insertions(+), 15 deletions(-) + +diff --git a/libmultipath/sysfs.c b/libmultipath/sysfs.c +index 5390de62..7a2af1ea 100644 +--- a/libmultipath/sysfs.c ++++ b/libmultipath/sysfs.c +@@ -344,24 +344,23 @@ bool sysfs_is_multipathed(struct path *pp, bool set_wwid) + pthread_cleanup_push(close_fd, (void *)fd); + nr = read(fd, uuid, sizeof(uuid)); + if (nr > (int)UUID_PREFIX_LEN && +- !memcmp(uuid, UUID_PREFIX, UUID_PREFIX_LEN)) ++ !memcmp(uuid, UUID_PREFIX, UUID_PREFIX_LEN)) { + found = true; +- else if (nr < 0) { ++ if (set_wwid) { ++ nr -= UUID_PREFIX_LEN; ++ memcpy(pp->wwid, uuid + UUID_PREFIX_LEN, nr); ++ if (nr == WWID_SIZE) { ++ condlog(4, "%s: overflow while reading from %s", ++ __func__, pathbuf); ++ pp->wwid[0] = '\0'; ++ } else { ++ pp->wwid[nr] = '\0'; ++ strchop(pp->wwid); ++ } ++ } ++ } else if (nr < 0) + condlog(1, "%s: error reading from %s: %m", + __func__, pathbuf); +- } +- if (found && set_wwid) { +- nr -= UUID_PREFIX_LEN; +- memcpy(pp->wwid, uuid + UUID_PREFIX_LEN, nr); +- if (nr == WWID_SIZE) { +- condlog(4, "%s: overflow while reading from %s", +- __func__, pathbuf); +- pp->wwid[0] = '\0'; +- } else { +- pp->wwid[nr] = '\0'; +- strchop(pp->wwid); +- } +- } + + pthread_cleanup_pop(1); + } diff --git a/0123-kpartx-free-loop-device-after-listing-partitions.patch b/0135-kpartx-free-loop-device-after-listing-partitions.patch similarity index 95% rename from 0123-kpartx-free-loop-device-after-listing-partitions.patch rename to 0135-kpartx-free-loop-device-after-listing-partitions.patch index 4db7cfd..566bee4 100644 --- a/0123-kpartx-free-loop-device-after-listing-partitions.patch +++ b/0135-kpartx-free-loop-device-after-listing-partitions.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Benjamin Marzinski -Date: Tue, 9 Feb 2021 17:16:04 -0600 +Date: Wed, 24 Feb 2021 00:05:13 -0600 Subject: [PATCH] kpartx: free loop device after listing partitions If "kpartx -l" is run on a file that doesn't already have a loop device @@ -18,6 +18,7 @@ at normal verbosity. Fixes: da59d15c6 ("Fix loopback file with kpartx -av") Signed-off-by: Benjamin Marzinski +Reviewed-by: Martin Wilck --- kpartx/kpartx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) @@ -56,6 +57,3 @@ index 6a7933fa..8ff116b8 100644 } end: --- -2.17.2 - diff --git a/0136-libmultipath-merge-update_multipath_table-and-update.patch b/0136-libmultipath-merge-update_multipath_table-and-update.patch new file mode 100644 index 0000000..482f122 --- /dev/null +++ b/0136-libmultipath-merge-update_multipath_table-and-update.patch @@ -0,0 +1,229 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 17 Mar 2021 17:18:22 +0100 +Subject: [PATCH] libmultipath: merge update_multipath_table() and + update_multipath_status() + +Since 378cb66 ("multipath: use update_pathvec_from_dm()"), +we remove paths and even pathgroups from multipathd's data structures +in update_multipath_table() if these paths are found to be non-existent. +But update_multipath_status() is called afterwards, and it +uses the kernel's mapping of pathgroups and paths, which won't match +any more if any members had been removed. disassemble_status() returns +an error if the number of path groups doesn't match, causing the +entire structure setup to fail. And because disassemble_status() +doesn't check the dev_t against the corresponding values in multipathd's +data structures, it may assign wrong DM state to paths. + +Fix this by calling disassemble_status() before making any changes to +the data structure in update_pathvec_from_dm(). This can be easily +done, because every call to update_multipath_status() is preceded +by a call to update_multipath_table() anyway, and vice versa. So +we simply merge the two functions into one. This actually simplifies +the code for all callers. + +As we remove a symbol, the major library version must be bumped. + +Fixes: 378cb66 ("multipath: use update_pathvec_from_dm()") +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + libmpathpersist/mpath_persist.c | 1 - + libmultipath/libmultipath.version | 30 ++++++++---------------- + libmultipath/structs_vec.c | 38 ++++++++----------------------- + multipath/main.c | 6 ++--- + multipathd/main.c | 5 +--- + 5 files changed, 21 insertions(+), 59 deletions(-) + +diff --git a/libmpathpersist/mpath_persist.c b/libmpathpersist/mpath_persist.c +index 5c95af20..190e9707 100644 +--- a/libmpathpersist/mpath_persist.c ++++ b/libmpathpersist/mpath_persist.c +@@ -408,7 +408,6 @@ get_mpvec (vector curmp, vector pathvec, char * refwwid) + continue; + + if (update_multipath_table(mpp, pathvec, DI_CHECKER) != DMP_OK || +- update_multipath_status(mpp) != DMP_OK || + update_mpp_paths(mpp, pathvec)) { + condlog(1, "error parsing map %s", mpp->wwid); + remove_map(mpp, pathvec, curmp, PURGE_VEC); +diff --git a/libmultipath/libmultipath.version b/libmultipath/libmultipath.version +index e9b4608f..0cff3111 100644 +--- a/libmultipath/libmultipath.version ++++ b/libmultipath/libmultipath.version +@@ -31,7 +31,7 @@ + * The new version inherits the previous ones. + */ + +-LIBMULTIPATH_4.0.0 { ++LIBMULTIPATH_5.0.0 { + global: + /* symbols referenced by multipath and multipathd */ + add_foreign; +@@ -198,7 +198,6 @@ global: + uevent_is_mpath; + uevent_listen; + update_mpp_paths; +- update_multipath_status; + update_multipath_strings; + update_multipath_table; + update_pathvec_from_dm; +@@ -256,33 +255,22 @@ global: + libmultipath_init; + libmultipath_exit; + +-local: +- *; +-}; +- +-LIBMULTIPATH_4.1.0 { +-global: ++ /* added in 4.1.0 */ + libmp_verbosity; +-} LIBMULTIPATH_4.0.0; + +-LIBMULTIPATH_4.2.0 { +-global: ++ /* added in 4.2.0 */ + dm_prereq; + skip_libmp_dm_init; +-} LIBMULTIPATH_4.1.0; + +-LIBMULTIPATH_4.3.0 { +-global: ++ /* added in 4.3.0 */ + start_checker_thread; +-} LIBMULTIPATH_4.2.0; + +-LIBMULTIPATH_4.4.0 { +-global: ++ /* added in 4.4.0 */ + get_next_string; +-} LIBMULTIPATH_4.3.0; + +-LIBMULITIPATH_4.5.0 { +-global: ++ /* added in 4.5.0 */ + get_vpd_sgio; + trigger_partitions_udev_change; +-} LIBMULTIPATH_4.4.0; ++local: ++ *; ++}; +diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c +index 47b1d03e..d242c06b 100644 +--- a/libmultipath/structs_vec.c ++++ b/libmultipath/structs_vec.c +@@ -423,44 +423,27 @@ update_multipath_table (struct multipath *mpp, vector pathvec, int flags) + + r = dm_get_map(mpp->alias, &mpp->size, params); + if (r != DMP_OK) { +- condlog(3, "%s: %s", mpp->alias, (r == DMP_ERR)? "error getting table" : "map not present"); ++ condlog(2, "%s: %s", mpp->alias, (r == DMP_ERR)? "error getting table" : "map not present"); + return r; + } + + if (disassemble_map(pathvec, params, mpp)) { +- condlog(3, "%s: cannot disassemble map", mpp->alias); ++ condlog(2, "%s: cannot disassemble map", mpp->alias); + return DMP_ERR; + } + ++ *params = '\0'; ++ if (dm_get_status(mpp->alias, params) != DMP_OK) ++ condlog(2, "%s: %s", mpp->alias, (r == DMP_ERR)? "error getting status" : "map not present"); ++ else if (disassemble_status(params, mpp)) ++ condlog(2, "%s: cannot disassemble status", mpp->alias); ++ + /* FIXME: we should deal with the return value here */ + update_pathvec_from_dm(pathvec, mpp, flags); + + return DMP_OK; + } + +-int +-update_multipath_status (struct multipath *mpp) +-{ +- int r = DMP_ERR; +- char status[PARAMS_SIZE] = {0}; +- +- if (!mpp) +- return r; +- +- r = dm_get_status(mpp->alias, status); +- if (r != DMP_OK) { +- condlog(3, "%s: %s", mpp->alias, (r == DMP_ERR)? "error getting status" : "map not present"); +- return r; +- } +- +- if (disassemble_status(status, mpp)) { +- condlog(3, "%s: cannot disassemble status", mpp->alias); +- return DMP_ERR; +- } +- +- return DMP_OK; +-} +- + static struct path *find_devt_in_pathgroups(const struct multipath *mpp, + const char *dev_t) + { +@@ -538,11 +521,8 @@ update_multipath_strings(struct multipath *mpp, vector pathvec) + r = update_multipath_table(mpp, pathvec, 0); + if (r != DMP_OK) + return r; +- sync_paths(mpp, pathvec); + +- r = update_multipath_status(mpp); +- if (r != DMP_OK) +- return r; ++ sync_paths(mpp, pathvec); + + vector_foreach_slot(mpp->pg, pgp, i) + if (pgp->paths) +diff --git a/multipath/main.c b/multipath/main.c +index 3f97582b..ef89c7cf 100644 +--- a/multipath/main.c ++++ b/multipath/main.c +@@ -196,8 +196,7 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector pathvec, char * refwwid) + continue; + } + +- if (update_multipath_table(mpp, pathvec, flags) != DMP_OK || +- update_multipath_status(mpp) != DMP_OK) { ++ if (update_multipath_table(mpp, pathvec, flags) != DMP_OK) { + condlog(1, "error parsing map %s", mpp->wwid); + remove_map(mpp, pathvec, curmp, PURGE_VEC); + i--; +@@ -263,8 +262,7 @@ static int check_usable_paths(struct config *conf, + if (mpp == NULL) + goto free; + +- if (update_multipath_table(mpp, pathvec, 0) != DMP_OK || +- update_multipath_status(mpp) != DMP_OK) ++ if (update_multipath_table(mpp, pathvec, 0) != DMP_OK) + goto free; + + vector_foreach_slot (mpp->pg, pg, i) { +diff --git a/multipathd/main.c b/multipathd/main.c +index e0797ccd..154a4eef 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -559,8 +559,6 @@ add_map_without_path (struct vectors *vecs, const char *alias) + + if (update_multipath_table(mpp, vecs->pathvec, 0) != DMP_OK) + goto out; +- if (update_multipath_status(mpp) != DMP_OK) +- goto out; + + if (!vector_alloc_slot(vecs->mpvec)) + goto out; +@@ -1469,8 +1467,7 @@ map_discovery (struct vectors * vecs) + return 1; + + vector_foreach_slot (vecs->mpvec, mpp, i) +- if (update_multipath_table(mpp, vecs->pathvec, 0) != DMP_OK || +- update_multipath_status(mpp) != DMP_OK) { ++ if (update_multipath_table(mpp, vecs->pathvec, 0) != DMP_OK) { + remove_map(mpp, vecs->pathvec, vecs->mpvec, PURGE_VEC); + i--; + } diff --git a/0137-11-dm-mpath.rules-run-multipath-U-with-v1.patch b/0137-11-dm-mpath.rules-run-multipath-U-with-v1.patch new file mode 100644 index 0000000..eb50696 --- /dev/null +++ b/0137-11-dm-mpath.rules-run-multipath-U-with-v1.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Wed, 17 Mar 2021 17:30:54 +0100 +Subject: [PATCH] 11-dm-mpath.rules: run "multipath -U" with -v1 + +In cases where some path devices are temporarily unavailable (e.g. failover), +high amounts of error messages such as these are seen: + +Feb 27 08:02:03 ictm1608s02h1 multipath[1420]: get_udev_device: failed to look up 65:224 with type 1 +Feb 27 08:02:03 ictm1608s02h1 multipath[1420]: 3600a098000aada210000f1625de51ed9: discarding non-existing path 65:224 + +This is because every invocation of "multipath -U" prints these messages +at the default log level (-v2). In the case of "multipath -U", these +messages aren't important, and in failover situations, "multipath -U" is +run pretty often, spamming the log with many similar messages. + +Generally reducing the log level of these messages would be wrong, +because they are important for multipathd's operation, to verify that +multipathd does the right thing when discovering a discrepancy between the dm +state and the devices present in the system. Therefore, just decrease the +verbosity with which we invoke "multipath -U" in the udev rules. + +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + multipath/11-dm-mpath.rules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipath/11-dm-mpath.rules b/multipath/11-dm-mpath.rules +index cd522e8c..d191ae8d 100644 +--- a/multipath/11-dm-mpath.rules ++++ b/multipath/11-dm-mpath.rules +@@ -32,7 +32,7 @@ ACTION=="add", ENV{.MPATH_DEVICE_READY_OLD}=="1", GOTO="paths_ok" + + # Check the map state directly with multipath -U. + # This doesn't attempt I/O on the device. +-PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -U %k", GOTO="paths_ok" ++PROGRAM=="$env{MPATH_SBIN_PATH}/multipath -U -v1 %k", GOTO="paths_ok" + ENV{MPATH_DEVICE_READY}="0", GOTO="mpath_action" + LABEL="paths_ok" + diff --git a/0138-multipath-tools-tests-check-if-sys-dev-block-is-non-.patch b/0138-multipath-tools-tests-check-if-sys-dev-block-is-non-.patch new file mode 100644 index 0000000..534ebba --- /dev/null +++ b/0138-multipath-tools-tests-check-if-sys-dev-block-is-non-.patch @@ -0,0 +1,62 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Thu, 18 Mar 2021 09:50:55 +0100 +Subject: [PATCH] multipath-tools tests: check if /sys/dev/block is non-empty + +Since f131e31 ("multipath-tools: devt test: avoid failure when run in +containers"), we check the existence of /sys/dev/block before running +the devt test. It turns out that on recent releases of podman (3.0.1), +this check is insufficient, because /sys/dev/block exists now in +containers, albeit empty. So we need to check for actual entries +in the directory. + +Fixes: f131e31 ("multipath-tools: devt test: avoid failure when run in containers") + +Reviewed-by: Benjamin Marzinski +Signed-off-by: Benjamin Marzinski +--- + tests/devt.c | 22 +++++++++++++++++----- + 1 file changed, 17 insertions(+), 5 deletions(-) + +diff --git a/tests/devt.c b/tests/devt.c +index 02f2e8f3..d971302c 100644 +--- a/tests/devt.c ++++ b/tests/devt.c +@@ -13,7 +13,9 @@ + #include + #include + #include ++#include + #include ++#include + #include "util.h" + #include "debug.h" + +@@ -21,12 +23,22 @@ + + static bool sys_dev_block_exists(void) + { +- int fd; +- bool rc; ++ DIR *dir; ++ bool rc = false; + +- fd = open("/sys/dev/block", O_RDONLY|O_DIRECTORY); +- rc = (fd != -1); +- close(fd); ++ dir = opendir("/sys/dev/block"); ++ if (dir != NULL) { ++ struct dirent *de; ++ ++ while((de = readdir(dir)) != NULL) { ++ if (strcmp(de->d_name, ".") && ++ strcmp(de->d_name, "..")) { ++ rc = true; ++ break; ++ } ++ } ++ } ++ closedir(dir); + return rc; + } + diff --git a/0139-multipathd-reduce-log-levels-in-cli_add_map.patch b/0139-multipathd-reduce-log-levels-in-cli_add_map.patch new file mode 100644 index 0000000..85823f0 --- /dev/null +++ b/0139-multipathd-reduce-log-levels-in-cli_add_map.patch @@ -0,0 +1,36 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 19 Mar 2021 09:50:46 +0100 +Subject: [PATCH] multipathd: reduce log levels in cli_add_map() + +Normally "add map" will be used to add a map which doesn't exist +yet. Thus not finding this map in the first place is not a problem +indicator and should be logged at level 3 only. + +Signed-off-by: Benjamin Marzinski +--- + multipathd/cli_handlers.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c +index 7f3e61f6..1de6ad8e 100644 +--- a/multipathd/cli_handlers.c ++++ b/multipathd/cli_handlers.c +@@ -852,14 +852,15 @@ cli_add_map (void * v, char ** reply, int * len, void * data) + } + do { + if (dm_get_major_minor(param, &major, &minor) < 0) +- condlog(2, "%s: not a device mapper table", param); ++ condlog(count ? 2 : 3, ++ "%s: not a device mapper table", param); + else { + sprintf(dev_path, "dm-%d", minor); + alias = dm_mapname(major, minor); + } + /*if there is no mapname found, we first create the device*/ + if (!alias && !count) { +- condlog(2, "%s: mapname not found for %d:%d", ++ condlog(3, "%s: mapname not found for %d:%d", + param, major, minor); + get_refwwid(CMD_NONE, param, DEV_DEVMAP, + vecs->pathvec, &refwwid); diff --git a/0140-multipath-tools-fix-format-in-multipath.conf.5-to-be.patch b/0140-multipath-tools-fix-format-in-multipath.conf.5-to-be.patch new file mode 100644 index 0000000..71c4413 --- /dev/null +++ b/0140-multipath-tools-fix-format-in-multipath.conf.5-to-be.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Xose Vazquez Perez +Date: Fri, 19 Mar 2021 17:18:56 +0100 +Subject: [PATCH] multipath-tools: fix format in multipath.conf.5 to be + consistent + +Cc: Martin Wilck +Cc: Benjamin Marzinski +Cc: Christophe Varoqui +Cc: DM-DEVEL ML +Signed-off-by: Xose Vazquez Perez +Reviewed-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + multipath/multipath.conf.5 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 +index 73977b97..2aa0f526 100644 +--- a/multipath/multipath.conf.5 ++++ b/multipath/multipath.conf.5 +@@ -1283,7 +1283,7 @@ to use the default uid_attribute, \fIID_SERIAL\fR, or sysfs for getting their + wwid. + .RS + .TP +-The default is \fBno\fR ++The default is: \fBno\fR + .RE + . + . diff --git a/0141-multipath-tools-use-same-format-for-default-values-i.patch b/0141-multipath-tools-use-same-format-for-default-values-i.patch new file mode 100644 index 0000000..1fc374b --- /dev/null +++ b/0141-multipath-tools-use-same-format-for-default-values-i.patch @@ -0,0 +1,41 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Xose Vazquez Perez +Date: Sat, 20 Mar 2021 03:13:07 +0100 +Subject: [PATCH] multipath-tools: use same format for default values in + multipath.conf.5 + +For max_sectors_kb, replace "device dependent" with its sysfs path. +And use as wildcard for device in paths. + +Cc: Martin Wilck +Cc: Benjamin Marzinski +Cc: Christophe Varoqui +Cc: DM-DEVEL ML +Reviewed-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + multipath/multipath.conf.5 | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 +index 2aa0f526..064e4826 100644 +--- a/multipath/multipath.conf.5 ++++ b/multipath/multipath.conf.5 +@@ -647,7 +647,7 @@ does not respond to the checker command after \fIchecker_timeout\fR + seconds have elapsed, it is considered down. + .RS + .TP +-The default is: in \fB/sys/block/sd/device/timeout\fR ++The default is: in \fB/sys/block//device/timeout\fR + .RE + . + . +@@ -1242,7 +1242,7 @@ Sets the max_sectors_kb device parameter on all path devices and the multipath + device to the specified value. + .RS + .TP +-The default is: \fB\fR ++The default is: in \fB/sys/block//queue/max_sectors_kb\fR + .RE + . + . diff --git a/0142-multipathd-fix-NULL-dereference-in-check_path.patch b/0142-multipathd-fix-NULL-dereference-in-check_path.patch new file mode 100644 index 0000000..3e7e86f --- /dev/null +++ b/0142-multipathd-fix-NULL-dereference-in-check_path.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: lixiaokeng +Date: Tue, 23 Mar 2021 19:50:02 +0800 +Subject: [PATCH] multipathd fix NULL dereference in check_path + +When iscsi login/logout and multipath command are executed +concurrently, there is a coredump. + +The reason is: +check_path + ->update_multipath_strings + ->sync_paths + ->orphan_path //pp->mpp is set to NULL + ->update_multipath_status + ->dm_get_status //return DMP_NOT_FOUND + ->condlog //pp->mpp->alias, NULL dereference + +Here we don't dereference pp-> mpp if it is NULL. + +Signed-off-by: Lixiaokeng +Reviewed-by: Martin Wilck +Signed-off-by: Benjamin Marzinski +--- + multipathd/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/multipathd/main.c b/multipathd/main.c +index 154a4eef..1df69096 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -2250,7 +2250,7 @@ check_path (struct vectors * vecs, struct path * pp, unsigned int ticks) + if (ret == DMP_NOT_FOUND) { + /* multipath device missing. Likely removed */ + condlog(1, "%s: multipath device '%s' not found", +- pp->dev, pp->mpp->alias); ++ pp->dev, pp->mpp ? pp->mpp->alias : ""); + return 0; + } else + condlog(1, "%s: Couldn't synchronize with kernel state", diff --git a/0143-libmultipath-avoid-infinite-loop-with-bad-vpd-page-8.patch b/0143-libmultipath-avoid-infinite-loop-with-bad-vpd-page-8.patch new file mode 100644 index 0000000..d4a4dd0 --- /dev/null +++ b/0143-libmultipath-avoid-infinite-loop-with-bad-vpd-page-8.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 24 Mar 2021 14:15:02 -0500 +Subject: [PATCH] libmultipath: avoid infinite loop with bad vpd page 83 + identifier + +If a device with a scsi name identifier has an unknown prefix, +parse_vpd_pg83() needs to advance to the next identifier, instead of +simply trying the same one again in an infinite loop. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/discovery.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index f216a724..5727f7a6 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -1157,7 +1157,7 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, + if (memcmp(d + 4, "eui.", 4) && + memcmp(d + 4, "naa.", 4) && + memcmp(d + 4, "iqn.", 4)) +- continue; ++ break; + if (prio < 4) { + prio = 4; + vpd = d; diff --git a/0144-libmultipath-fix-priorities-in-parse_vpd_pg83.patch b/0144-libmultipath-fix-priorities-in-parse_vpd_pg83.patch new file mode 100644 index 0000000..dbd28e9 --- /dev/null +++ b/0144-libmultipath-fix-priorities-in-parse_vpd_pg83.patch @@ -0,0 +1,46 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 24 Mar 2021 14:48:07 -0500 +Subject: [PATCH] libmultipath: fix priorities in parse_vpd_pg83 + +The priorities for the EUI-64 (0x02) and NAME (0x08) scsi identifiers in +parse_vpd_pg83() don't match their priorities in 55-scsi-sg3_id.rules. +Switch them so that they match. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/discovery.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index 5727f7a6..f8044141 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -1152,19 +1152,19 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, + vpd = d; + } + break; +- case 0x8: +- /* SCSI Name: Prio 4 */ +- if (memcmp(d + 4, "eui.", 4) && +- memcmp(d + 4, "naa.", 4) && +- memcmp(d + 4, "iqn.", 4)) +- break; ++ case 0x2: ++ /* EUI-64: Prio 4 */ + if (prio < 4) { + prio = 4; + vpd = d; + } + break; +- case 0x2: +- /* EUI-64: Prio 3 */ ++ case 0x8: ++ /* SCSI Name: Prio 3 */ ++ if (memcmp(d + 4, "eui.", 4) && ++ memcmp(d + 4, "naa.", 4) && ++ memcmp(d + 4, "iqn.", 4)) ++ break; + if (prio < 3) { + prio = 3; + vpd = d; diff --git a/0145-multipathd-improve-getting-parent-udevice-in-rescan_.patch b/0145-multipathd-improve-getting-parent-udevice-in-rescan_.patch new file mode 100644 index 0000000..a3ceeab --- /dev/null +++ b/0145-multipathd-improve-getting-parent-udevice-in-rescan_.patch @@ -0,0 +1,40 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 24 Mar 2021 21:48:15 -0500 +Subject: [PATCH] multipathd: improve getting parent udevice in rescan_path + +Instead of looping through parents and checking, just call +udev_device_get_parent_with_subsystem_devtype() to get the +right one. + +Signed-off-by: Benjamin Marzinski +--- + multipathd/main.c | 14 +++++--------- + 1 file changed, 5 insertions(+), 9 deletions(-) + +diff --git a/multipathd/main.c b/multipathd/main.c +index 1df69096..bc747d0e 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -822,16 +822,12 @@ ev_remove_map (char * devname, char * alias, int minor, struct vectors * vecs) + } + + static void +-rescan_path(struct udev_device *parent) ++rescan_path(struct udev_device *ud) + { +- while(parent) { +- const char *subsys = udev_device_get_subsystem(parent); +- if (subsys && !strncmp(subsys, "scsi", 4)) +- break; +- parent = udev_device_get_parent(parent); +- } +- if (parent) +- sysfs_attr_set_value(parent, "rescan", "1", strlen("1")); ++ ud = udev_device_get_parent_with_subsystem_devtype(ud, "scsi", ++ "scsi_device"); ++ if (ud) ++ sysfs_attr_set_value(ud, "rescan", "1", strlen("1")); + } + + void diff --git a/0146-multipathd-don-t-trigger-uevent-for-partitions-on-ww.patch b/0146-multipathd-don-t-trigger-uevent-for-partitions-on-ww.patch new file mode 100644 index 0000000..160adc2 --- /dev/null +++ b/0146-multipathd-don-t-trigger-uevent-for-partitions-on-ww.patch @@ -0,0 +1,26 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Wed, 24 Mar 2021 23:24:08 -0500 +Subject: [PATCH] multipathd: don't trigger uevent for partitions on wwid + change + +If the wwid changed, the device is no longer the same, so sending add +events to the devices partitions doesn't make any sense. + +Signed-off-by: Benjamin Marzinski +--- + multipathd/main.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/multipathd/main.c b/multipathd/main.c +index bc747d0e..3579bad7 100644 +--- a/multipathd/main.c ++++ b/multipathd/main.c +@@ -845,7 +845,6 @@ handle_path_wwid_change(struct path *pp, struct vectors *vecs) + } + rescan_path(udd); + sysfs_attr_set_value(udd, "uevent", "add", strlen("add")); +- trigger_partitions_udev_change(udd, "add", strlen("add")); + udev_device_unref(udd); + } + diff --git a/0124-RH-fixup-udev-rules-for-redhat.patch b/0147-RH-fixup-udev-rules-for-redhat.patch similarity index 99% rename from 0124-RH-fixup-udev-rules-for-redhat.patch rename to 0147-RH-fixup-udev-rules-for-redhat.patch index d5bbd5b..efb8857 100644 --- a/0124-RH-fixup-udev-rules-for-redhat.patch +++ b/0147-RH-fixup-udev-rules-for-redhat.patch @@ -61,6 +61,3 @@ index 0828a8f7..b9bbb3cf 100644 $(RM) $(DESTDIR)$(man8dir)/$(EXEC).8.gz $(RM) $(DESTDIR)$(man5dir)/$(EXEC).conf.5.gz --- -2.17.2 - diff --git a/0125-RH-Remove-the-property-blacklist-exception-builtin.patch b/0148-RH-Remove-the-property-blacklist-exception-builtin.patch similarity index 95% rename from 0125-RH-Remove-the-property-blacklist-exception-builtin.patch rename to 0148-RH-Remove-the-property-blacklist-exception-builtin.patch index 9c44867..dcb1491 100644 --- a/0125-RH-Remove-the-property-blacklist-exception-builtin.patch +++ b/0148-RH-Remove-the-property-blacklist-exception-builtin.patch @@ -43,10 +43,10 @@ index 6c6a5979..785f5ee9 100644 udev_device_get_properties_list_entry(udev)) { diff --git a/multipath/multipath.conf.5 b/multipath/multipath.conf.5 -index 8ef3a747..1e95a854 100644 +index 064e4826..0d2bce09 100644 --- a/multipath/multipath.conf.5 +++ b/multipath/multipath.conf.5 -@@ -1333,9 +1333,14 @@ keywords. Both are regular expressions. For a full description of these keywords +@@ -1347,9 +1347,14 @@ keywords. Both are regular expressions. For a full description of these keywords Regular expression for an udev property. All devices that have matching udev properties will be excluded/included. The handling of the \fIproperty\fR keyword is special, @@ -62,7 +62,7 @@ index 8ef3a747..1e95a854 100644 . .RS .PP -@@ -1346,10 +1351,6 @@ Blacklisting by missing properties is only applied to devices which do have the +@@ -1360,10 +1365,6 @@ Blacklisting by missing properties is only applied to devices which do have the property specified by \fIuid_attribute\fR (e.g. \fIID_SERIAL\fR) set. Previously, it was applied to every device, possibly causing devices to be blacklisted because of temporary I/O error conditions. @@ -74,7 +74,7 @@ index 8ef3a747..1e95a854 100644 .TP .B protocol diff --git a/tests/blacklist.c b/tests/blacklist.c -index 0b42e255..4d595eda 100644 +index 882aa3a1..6a22b660 100644 --- a/tests/blacklist.c +++ b/tests/blacklist.c @@ -375,9 +375,8 @@ static void test_property_missing(void **state) @@ -99,6 +99,3 @@ index 0b42e255..4d595eda 100644 } /* This one matches the property whitelist, to test the other missing --- -2.17.2 - diff --git a/0126-RH-don-t-start-without-a-config-file.patch b/0149-RH-don-t-start-without-a-config-file.patch similarity index 96% rename from 0126-RH-don-t-start-without-a-config-file.patch rename to 0149-RH-don-t-start-without-a-config-file.patch index 2931726..1d5c693 100644 --- a/0126-RH-don-t-start-without-a-config-file.patch +++ b/0149-RH-don-t-start-without-a-config-file.patch @@ -20,10 +20,10 @@ Signed-off-by: Benjamin Marzinski 5 files changed, 18 insertions(+) diff --git a/libmultipath/config.c b/libmultipath/config.c -index be310159..8d291491 100644 +index 30046a17..5f35c3d3 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c -@@ -893,6 +893,19 @@ int _init_config (const char *file, struct config *conf) +@@ -895,6 +895,19 @@ int _init_config (const char *file, struct config *conf) goto out; } factorize_hwtable(conf->hwtable, builtin_hwtable_size, file); @@ -44,7 +44,7 @@ index be310159..8d291491 100644 conf->processed_main_config = 1; diff --git a/libmultipath/config.h b/libmultipath/config.h -index 9ce37f16..7f8d9cd0 100644 +index 933fe0d1..5f01c1fc 100644 --- a/libmultipath/config.h +++ b/libmultipath/config.h @@ -9,6 +9,7 @@ @@ -92,6 +92,3 @@ index 7d547fa7..af592057 100644 DefaultDependencies=no Conflicts=shutdown.target ConditionKernelCommandLine=!nompath --- -2.17.2 - diff --git a/0127-RH-Fix-nvme-function-missing-argument.patch b/0150-RH-Fix-nvme-function-missing-argument.patch similarity index 98% rename from 0127-RH-Fix-nvme-function-missing-argument.patch rename to 0150-RH-Fix-nvme-function-missing-argument.patch index b5c63c0..ced7159 100644 --- a/0127-RH-Fix-nvme-function-missing-argument.patch +++ b/0150-RH-Fix-nvme-function-missing-argument.patch @@ -24,6 +24,3 @@ index adb192b6..bfd10ef8 100644 void argconfig_append_usage(const char *str); void argconfig_print_help(const char *program_desc, const struct argconfig_commandline_options *options); --- -2.17.2 - diff --git a/0128-RH-use-rpm-optflags-if-present.patch b/0151-RH-use-rpm-optflags-if-present.patch similarity index 99% rename from 0128-RH-use-rpm-optflags-if-present.patch rename to 0151-RH-use-rpm-optflags-if-present.patch index f765f47..7b0334d 100644 --- a/0128-RH-use-rpm-optflags-if-present.patch +++ b/0151-RH-use-rpm-optflags-if-present.patch @@ -55,6 +55,3 @@ index 24e943d5..e978d306 100644 @echo building $@ because of $? - $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) -c -o $@ $< --- -2.17.2 - diff --git a/0129-RH-add-mpathconf.patch b/0152-RH-add-mpathconf.patch similarity index 99% rename from 0129-RH-add-mpathconf.patch rename to 0152-RH-add-mpathconf.patch index 346251a..d262f55 100644 --- a/0129-RH-add-mpathconf.patch +++ b/0152-RH-add-mpathconf.patch @@ -21,10 +21,10 @@ Signed-off-by: Benjamin Marzinski create mode 100644 multipath/mpathconf.8 diff --git a/libmultipath/config.c b/libmultipath/config.c -index 8d291491..bbdd1617 100644 +index 5f35c3d3..cee3bbb7 100644 --- a/libmultipath/config.c +++ b/libmultipath/config.c -@@ -895,6 +895,8 @@ int _init_config (const char *file, struct config *conf) +@@ -897,6 +897,8 @@ int _init_config (const char *file, struct config *conf) factorize_hwtable(conf->hwtable, builtin_hwtable_size, file); } else { condlog(0, "/etc/multipath.conf does not exist, blacklisting all devices."); @@ -769,6 +769,3 @@ index 00000000..83515eb4 +.BR service (8), +.SH AUTHOR +Benjamin Marzinski --- -2.17.2 - diff --git a/0130-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch b/0153-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch similarity index 96% rename from 0130-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch rename to 0153-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch index 3f0a9ad..557669b 100644 --- a/0130-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +++ b/0153-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch @@ -20,7 +20,7 @@ Signed-off-by: Benjamin Marzinski 3 files changed, 59 insertions(+), 3 deletions(-) diff --git a/multipath/main.c b/multipath/main.c -index 9ac42869..beaac3ca 100644 +index ef89c7cf..f618550d 100644 --- a/multipath/main.c +++ b/multipath/main.c @@ -122,7 +122,7 @@ usage (char * progname) @@ -41,7 +41,7 @@ index 9ac42869..beaac3ca 100644 " -c check if a device should be a path in a multipath device\n" " -C check if a multipath device has usable paths\n" " -q allow queue_if_no_path when multipathd is not running\n" -@@ -452,6 +454,50 @@ static void cleanup_vecs(void) +@@ -450,6 +452,50 @@ static void cleanup_vecs(void) free_pathvec(vecs.pathvec, FREE_PATHS); } @@ -92,7 +92,7 @@ index 9ac42869..beaac3ca 100644 static int configure (struct config *conf, enum mpath_cmds cmd, enum devtypes dev_type, char *devpath) -@@ -825,7 +871,7 @@ main (int argc, char *argv[]) +@@ -823,7 +869,7 @@ main (int argc, char *argv[]) conf = get_multipath_config(); conf->retrigger_tries = 0; conf->force_sync = 1; @@ -101,7 +101,7 @@ index 9ac42869..beaac3ca 100644 switch(arg) { case 1: printf("optarg : %s\n",optarg); break; -@@ -902,6 +948,10 @@ main (int argc, char *argv[]) +@@ -900,6 +946,10 @@ main (int argc, char *argv[]) case 'T': cmd = CMD_DUMP_CONFIG; break; @@ -149,6 +149,3 @@ index af592057..bc8fa07a 100644 ExecStart=/sbin/multipathd -d -s ExecReload=/sbin/multipathd reconfigure TasksMax=infinity --- -2.17.2 - diff --git a/0131-RH-reset-default-find_mutipaths-value-to-off.patch b/0154-RH-reset-default-find_mutipaths-value-to-off.patch similarity index 95% rename from 0131-RH-reset-default-find_mutipaths-value-to-off.patch rename to 0154-RH-reset-default-find_mutipaths-value-to-off.patch index 304db61..d5b5601 100644 --- a/0131-RH-reset-default-find_mutipaths-value-to-off.patch +++ b/0154-RH-reset-default-find_mutipaths-value-to-off.patch @@ -12,7 +12,7 @@ Signed-off-by: Benjamin Marzinski 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h -index 947ba467..518d0b16 100644 +index c27946c7..e0dd32ad 100644 --- a/libmultipath/defaults.h +++ b/libmultipath/defaults.h @@ -23,7 +23,7 @@ @@ -24,6 +24,3 @@ index 947ba467..518d0b16 100644 #define DEFAULT_FAST_IO_FAIL 5 #define DEFAULT_DEV_LOSS_TMO 600 #define DEFAULT_RETAIN_HWHANDLER RETAIN_HWHANDLER_ON --- -2.17.2 - diff --git a/0132-RH-attempt-to-get-ANA-info-via-sysfs-first.patch b/0155-RH-attempt-to-get-ANA-info-via-sysfs-first.patch similarity index 99% rename from 0132-RH-attempt-to-get-ANA-info-via-sysfs-first.patch rename to 0155-RH-attempt-to-get-ANA-info-via-sysfs-first.patch index 14b3367..06233ff 100644 --- a/0132-RH-attempt-to-get-ANA-info-via-sysfs-first.patch +++ b/0155-RH-attempt-to-get-ANA-info-via-sysfs-first.patch @@ -82,6 +82,3 @@ index b5c7873d..e139360c 100644 switch (rc) { case NVME_ANA_OPTIMIZED: --- -2.17.2 - diff --git a/0156-RH-make-parse_vpd_pg83-match-scsi_id-output.patch b/0156-RH-make-parse_vpd_pg83-match-scsi_id-output.patch new file mode 100644 index 0000000..0e30d1f --- /dev/null +++ b/0156-RH-make-parse_vpd_pg83-match-scsi_id-output.patch @@ -0,0 +1,51 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Benjamin Marzinski +Date: Thu, 25 Mar 2021 13:05:10 -0500 +Subject: [PATCH] RH: make parse_vpd_pg83 match scsi_id output + +Red Hat sets ID_SERIAL based on the result of scsi_id, instead of using +the result of sg_inq and 55-scsi-sg3_id.rules. Make parse_vpd_pg83 match +that. + +Signed-off-by: Benjamin Marzinski +--- + libmultipath/discovery.c | 18 ++---------------- + 1 file changed, 2 insertions(+), 16 deletions(-) + +diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c +index f8044141..e6590d07 100644 +--- a/libmultipath/discovery.c ++++ b/libmultipath/discovery.c +@@ -1135,12 +1135,9 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, + naa_prio = 7; + break; + case 2: +- /* IEEE Extended: Prio 6 */ +- naa_prio = 6; +- break; + case 3: +- /* IEEE Locally assigned: Prio 1 */ +- naa_prio = 1; ++ /* IEEE Extended or Locally assigned: Prio 6 */ ++ naa_prio = 6; + break; + default: + /* Default: no priority */ +@@ -1159,17 +1156,6 @@ parse_vpd_pg83(const unsigned char *in, size_t in_len, + vpd = d; + } + break; +- case 0x8: +- /* SCSI Name: Prio 3 */ +- if (memcmp(d + 4, "eui.", 4) && +- memcmp(d + 4, "naa.", 4) && +- memcmp(d + 4, "iqn.", 4)) +- break; +- if (prio < 3) { +- prio = 3; +- vpd = d; +- } +- break; + case 0x1: + /* T-10 Vendor ID: Prio 2 */ + if (prio < 2) { diff --git a/device-mapper-multipath.spec b/device-mapper-multipath.spec index ec5a48f..b8e18d7 100644 --- a/device-mapper-multipath.spec +++ b/device-mapper-multipath.spec @@ -1,6 +1,6 @@ Name: device-mapper-multipath Version: 0.8.5 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Tools to manage multipath devices using device-mapper License: GPLv2 URL: http://christophe.varoqui.free.fr/ @@ -132,16 +132,40 @@ Patch0119: 0119-pathinfo-call-filter_property-after-sysfs_pathinfo.patch Patch0120: 0120-libmultipath-pathinfo-call-filter_property-only-with.patch Patch0121: 0121-multipath-w-allow-removing-blacklisted-paths.patch Patch0122: 0122-libmultipath-fix-use-after-free-in-uev_add_path.patch -Patch0123: 0123-kpartx-free-loop-device-after-listing-partitions.patch -Patch0124: 0124-RH-fixup-udev-rules-for-redhat.patch -Patch0125: 0125-RH-Remove-the-property-blacklist-exception-builtin.patch -Patch0126: 0126-RH-don-t-start-without-a-config-file.patch -Patch0127: 0127-RH-Fix-nvme-function-missing-argument.patch -Patch0128: 0128-RH-use-rpm-optflags-if-present.patch -Patch0129: 0129-RH-add-mpathconf.patch -Patch0130: 0130-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch -Patch0131: 0131-RH-reset-default-find_mutipaths-value-to-off.patch -Patch0132: 0132-RH-attempt-to-get-ANA-info-via-sysfs-first.patch +Patch0123: 0123-multipath-tools-tests-fix-stringop-overflow-build-er.patch +Patch0124: 0124-libmultipath-cleanup-code-to-strip-wwid-trailing-spa.patch +Patch0125: 0125-libmultipath-cleanup-uid_attribute-checking-code.patch +Patch0126: 0126-multipathd-add-recheck_wwid-option-to-verify-the-pat.patch +Patch0127: 0127-libmultipath-check-if-user_friendly_name-is-in-use.patch +Patch0128: 0128-tests-add-tests-for-checking-if-alias-is-in-use.patch +Patch0129: 0129-multipath-tools-add-DellEMC-PowerStore-to-hardware-t.patch +Patch0130: 0130-multipath-tools-delete-a-space-in-multipath.conf.5-t.patch +Patch0131: 0131-multipath-tools-tests-allow-control-of-test-verbosit.patch +Patch0132: 0132-multipath-tools-devt-test-avoid-failure-when-run-in-.patch +Patch0133: 0133-multipath-tools-fix-compilation-errors-on-32-bit-mus.patch +Patch0134: 0134-libmultipath-fix-compilation-error-with-gcc-10-on-i3.patch +Patch0135: 0135-kpartx-free-loop-device-after-listing-partitions.patch +Patch0136: 0136-libmultipath-merge-update_multipath_table-and-update.patch +Patch0137: 0137-11-dm-mpath.rules-run-multipath-U-with-v1.patch +Patch0138: 0138-multipath-tools-tests-check-if-sys-dev-block-is-non-.patch +Patch0139: 0139-multipathd-reduce-log-levels-in-cli_add_map.patch +Patch0140: 0140-multipath-tools-fix-format-in-multipath.conf.5-to-be.patch +Patch0141: 0141-multipath-tools-use-same-format-for-default-values-i.patch +Patch0142: 0142-multipathd-fix-NULL-dereference-in-check_path.patch +Patch0143: 0143-libmultipath-avoid-infinite-loop-with-bad-vpd-page-8.patch +Patch0144: 0144-libmultipath-fix-priorities-in-parse_vpd_pg83.patch +Patch0145: 0145-multipathd-improve-getting-parent-udevice-in-rescan_.patch +Patch0146: 0146-multipathd-don-t-trigger-uevent-for-partitions-on-ww.patch +Patch0147: 0147-RH-fixup-udev-rules-for-redhat.patch +Patch0148: 0148-RH-Remove-the-property-blacklist-exception-builtin.patch +Patch0149: 0149-RH-don-t-start-without-a-config-file.patch +Patch0150: 0150-RH-Fix-nvme-function-missing-argument.patch +Patch0151: 0151-RH-use-rpm-optflags-if-present.patch +Patch0152: 0152-RH-add-mpathconf.patch +Patch0153: 0153-RH-add-wwids-from-kernel-cmdline-mpath.wwids-with-A.patch +Patch0154: 0154-RH-reset-default-find_mutipaths-value-to-off.patch +Patch0155: 0155-RH-attempt-to-get-ANA-info-via-sysfs-first.patch +Patch0156: 0156-RH-make-parse_vpd_pg83-match-scsi_id-output.patch # runtime Requires: %{name}-libs = %{version}-%{release} @@ -339,6 +363,19 @@ fi %{_pkgconfdir}/libdmmp.pc %changelog +* Fri Mar 26 2021 Benjamin Marzinski - 0.8.5-6 +- Change patch format to remove Git version + * Patches 0001-0122 only have the patch format modified +- Update to the head of the upstream staging branch plus redhat patches + * Patches 0123-0134 & 1036-0142 are from the upstream staging branch + * Patches 0143-1046 have been submitted upstream + * Patch 0156 is a Red Hat only patch. Red Hat udev rules set ID_SERIAL + from 60-persistent-storage.rules instead of 55-scsi-sg3_id.rules. + Multipath's parse_vpd_pg83() function needs to match the ID_SERIAL + value from udev. +- Rename files + * Previous patches 0123-0132 are now patches 1035 & 0147-0155 + * Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek - 0.8.5-5 - Rebuilt for updated systemd-rpm-macros See https://pagure.io/fesco/issue/2583.