multipath-tools 0.15.0#146
Open
mwilck wants to merge 101 commits into
Open
Conversation
Cc: Martin Wilck <mwilck@suse.com> Cc: Benjamin Marzinski <bmarzins@redhat.com> Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> Cc: DM_DEVEL-ML <dm-devel@lists.linux.dev> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
ACK from the Copyright holder. Cc: Martin Wilck <mwilck@suse.com> Cc: Benjamin Marzinski <bmarzins@redhat.com> Cc: Christophe Varoqui <christophe.varoqui@opensvc.com> Cc: DM_DEVEL-ML <dm-devel@lists.linux.dev> Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: Matthias Rudolph <Matthias.Rudolph@hitachivantara.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Some older SCSI devices return a SCSI-2 style vpd page 0x83, instead of a SPC-2/3 format one. The SCSI-2 page 83 format returns an IEEE WWN in binary encoded hexi-decimal in the 16 bytes following the initial 4-byte page 83 reply header. Check the 7th byte of the vpd page 83 buffer to determine whether this is a SCSI-2 or SPC-2/3 confomant one. Byte 7 is the 3rd byte of first Identification descriptor in a SPC-2/3 confromant vpd page 83. This is a reserved field, and is guaranteed to be 0. If it is not zero, then it is likely the 3rd byte of a SCSI-2 Identifier (The first 3 bytes of the ID are the Organizationally Unique Identifier). Both the sg_inq and scsi_id commands handle vpd page 83 this way. To make sure that the WWID which multipath reads directly from the device matches, it should handle this format as well. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
For saving test outputs in GitHub actions. Also add "test-outputs.cpio", although it'll be hardly used. Signed-off-by: Martin Wilck <mwilck@suse.com>
... and also the runner test script. Signed-off-by: Martin Wilck <mwilck@suse.com>
This is necessary for the runner-test executable, which may create several thousand threads. Signed-off-by: Martin Wilck <mwilck@suse.com>
Unless the expression starts with '!', we can omit braces in if: statements [1] [1] https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepsif Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
The "tar" package has now been added to the SUSE and openSUSE build containers, too [1]. [1] mwilck/build-multipath@3b68ea5 Signed-off-by: Martin Wilck <mwilck@suse.com>
Instead of duplicating the build step, simply set an environment variable.
For test-progs.tar, starting a container may be necessary.
I observed this otherwise:
building libdmmp.o because of /usr/include/json-c/json.h
/usr/include/json-c/arraylist.h /usr/include/json-c/debug.h
/usr/include/json-c/json_c_version.h ...
Signed-off-by: Martin Wilck <mwilck@suse.com>
We map PATH_TIMEOUT to PATH_DOWN in pathinfo(), but not in get_new_state(). Do it there, too, to treat the states consistently. This avoids logging "checker timed out" twice in update_path_state(), even if log_checker_err is set to "once". Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
This code adds a generic, abstract implementation of the kind of threads we need for checkers: detached threads that may time out. The design is such that these threads never access any memory of the calling program, simplifying the management of lifetimes of objects. See the documentation of the API in "runner.h". Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Add a test program for the "runner" thread implementation from the previous commit. The test program runs simulated "hanging" threads that may time out, and optionally kills all threads at an arbitrary point in time. See the comments at the top of the file for details. Also add a test driver script (runner-test.sh) with a few reasonable combinations of command line arguments. The test program has been used to test the "runner" implementation extensively on different architectures (x86_64, aarch64, ppc64le, s390x), using both valgrind and the gcc address sanitizer (libasan) for detection of memory leaks and use-after-free errors. For valgrind, a suppression file needs to be added, as valgrind doesn't seem to capture the deallocation of thread local storage for detached threads in the test case where the test program is killed. The suppression affects only memory allocated by glibc. This leak has not been seen with libasan, only with valgrind. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Use the generic runners to simplify the TUR checker code. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
The tur_deep_sleep() test serves to test the behavior of the tur checker when checkers time out and cannot be cancelled. Up to now the checker timed out on every TUR_SLEEP_INTERVALth invocation. That made it impossible to test the MAX_TIMEOUTS logic, which requires multiple consecutive timeouts. To fix it, invert the logic, so that the checker just succeeds on every TUR_SLEEP_INTERVALth call. Also, decrease loglevel of the messages from tur_deep_sleep(). Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Update ALUA asymmetric access state descriptions in the prioritizer to
match the shorter names defined in the SCSI kernel subsystem:
$ grep "{ SCSI_ACCESS_STATE_" linux/drivers/scsi/scsi_sysfs.c
{ SCSI_ACCESS_STATE_OPTIMAL, "active/optimized" },
{ SCSI_ACCESS_STATE_ACTIVE, "active/non-optimized" },
{ SCSI_ACCESS_STATE_STANDBY, "standby" },
{ SCSI_ACCESS_STATE_UNAVAILABLE, "unavailable" },
{ SCSI_ACCESS_STATE_LBA, "lba-dependent" },
{ SCSI_ACCESS_STATE_OFFLINE, "offline" },
{ SCSI_ACCESS_STATE_TRANSITIONING, "transitioning" },
This unifies diagnostic strings across the stack and replaces the misleading
"ARRAY BUG: invalid TPGs state!" message with the standard SPC "reserved"
designation. These codes are explicitly reserved for future standard
definitions rather than being treated as malformed states.
Cc: Martin Wilck <mwilck@suse.com>
Cc: Benjamin Marzinski <bmarzins@redhat.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>
Cc: DM_DEVEL-ML <dm-devel@lists.linux.dev>
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Don't "log runner 0x7b724a07a480 cancelled in state 'done'" at level 3. It's a fairly normal thing to happen. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Add generic messages for "timed out" and "still running". They will be needed by follow-up patches. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Make the contents of struct checker_class accessible to other code. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Add a set of simple functions to handle refcounted pointers. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Add a few tests (mostly meaningful with valgrind or ASAN) to test the shared pointer code. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
After d1ebd97 ("libmultipath: TUR checker: use runner threads"), this code is not used any more. Remove it. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Utilize the share_ptr code for tracking the refcount of checker classes. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Replace the hardcoded refcount handling in prio.c with shared_ptr. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Use shared_ptr to track the runner_context refcount. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Add a framework for an asynchronous path checker utilizing the recently added runner code for thread handling. This code has been derived from the TUR checker code by removing all references to the actual sending of TUR ioctls. Follow-up patches will convert the current TUR checker into an instance of this async checker class. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
If a checker shared library contains a symbol "libcheck_async_func", use this as a callback for the async checker functions, and do not read any other symbols from the .so file except the message table. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
The TUR checker now just exports the message table and the "libcheck_async_func" symbol. This converts it into an instance of the generic async checker model. With this change, struct checker_context isn't used any more and can be removed. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Document the fact that all path checkers are now asynchronous by default. Signed-off-by: Martin Wilck <mwilck@suse.com> Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
In the iet and datacore prioritizers, multipath was using sscanf to get a string for a 255 byte buffer, without limiting the size of the string. This could result in a buffer overflow, if there was a bad value in multipath.conf. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
disable_changed_wwids is deprecated and unused. Suggested-by: Xose Vazquez Perez <xose.vazquez@gmail.com> Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Reviewed-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Avoid that "git clang-format" wrongly indents the invocations of the macros make_test_vpd_str() and make_test_vpd_prespc3 in tests/vpd.c, by appending semicolons to the macro invocation as we did for other macros in the same file. Note: The indentation issue could also be fixed by adding these macros to the "StatementMacros:" directive in .clang-format. Signed-off-by: Martin Wilck <mwilck@suse.com>
With these changes, "git clang-format --commit 0.14.0" doesn't change any code. Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
We will use this branch to maintain the workflows separately from the actual code. That makes maintenance of the workflows easier for the stable branches. Signed-off-by: Martin Wilck <mwilck@suse.com>
actions/checkout@v4 uses the deprecated node 20. Signed-off-by: Martin Wilck <mwilck@suse.com>
setup-qemu-action@v2 uses node 20. Signed-off-by: Martin Wilck <mwilck@suse.com>
Use the special branch "workflows" for this purpose. It contains only files related to GitHub workflows. Signed-off-by: Martin Wilck <mwilck@suse.com>
Use the special branch "workflows" for this purpose. It contains only files related to GitHub workflows. Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@v4...v7) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 7. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v7) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '7' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 8. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v4...v8) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '8' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 6 to 21. - [Release notes](https://github.com/dawidd6/action-download-artifact/releases) - [Commits](dawidd6/action-download-artifact@v6...v21) --- updated-dependencies: - dependency-name: dawidd6/action-download-artifact dependency-version: '21' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
Collaborator
Author
Instead of reading /dev/disk/by-id, use the udev PATH_ID property to derive the device path. Signed-off-by: Martin Wilck <mwilck@suse.com> Tested-by: Arnaldo Viegas de Lima <arnaldo@viegasdelima.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
multipath-tools 0.15.0, 2026/07
User-visible changes
generic asynchronous checker framework. This improves the stability of
multipathd in the presence of non-responsive devices when using path
checkers other than
turanddirectio. Use theforce_syncparameter in
multipath.confto switch back to the previous, synchronousbehavior, especially if you observe strong spikes of CPU load on systems
with a lot of path devices. Note that the likelihood of such spikes should
be strongly reduced since multipath-tools 0.10.0. Commit 6f7daba ff.
rr_min_io,rr_min_io_rq, andrr_weightare nowdeprecated and have no effect. These options have not been supported by the
kernel since version 4.6. Users should remove them from
multipath.conf.Commits 91f91c7 ff.
the same terms are used as by the kernel ("lba-dependent", "transitioning").
Commit fa2eb12.
rejects this anyway. Commit b6c7aab.
Bug fixes
0x83 format for their device identifier. Commit ed6f6ae.
A crafted partition table with an extremely large number of partition entries
could trigger the overflow. Commit 8697ea7, 15310a3.
triggered by a maliciously crafted disk image. Commits c616a95 ff.
log_checker_errisset to
once. Commit 8933b22.Commit 4611f97.
newer, and properly use udev to derive path parameters. Commit 5cbd51e.
Fixes #145.
Other changes
CI
check_spellingGitHub Action after asecurity incident
reported against the action's source repository.
Shortlog
@bmarzins (7):
libmultipath: Handle SCSI-2 style vpd page 0x83 descriptors
libmultipath: deprecate rr_weight, and make it do nothing
libmultipath: deprecate rr_min_io_rq, and make it do nothing
libmultipath: deprecate rr_min_io
libmultipath: don't set hwhander for bio based devices
libmultipath: make sure sscanf sets a max field width for strings
Remove unsed DEFAULT_DISABLE_CHANGED_WWIDS define
@mwilck (79):
.clang-format: Add AllignArrayOfStructures
Makefile: add 'test-outputs.tar' target
Makefile: include top-level Makefile in test-progs.tar...
GitHub workflows: increase --pids-limit
GitHub workflows: simplify if: syntax
GitHub workflows: upload log files in case of failure
GitHub workflows: native.yml: always use tar for upload
GitHub workflows: native.yml: simplify libreadline handling
GitHub workflows: don't start container to build artifacts
multipathd: get_new_state: map PATH_TIMEOUT to PATH_DOWN
libmpathutil: add generic implementation for checker thread runners
multipath-tools tests: add test program for thread runners
libmultipath: TUR checker: use runner threads
libmultipath: tur checker: improve tur_deep_sleep() test
libmpathutil: runner: reduce a message loglevel
libmultipath: checkers: add two generic checker messages
libmultipath: checkers: move checker_class definition to checkers.h
libmpathutil: add implementation of generic shared pointer
multipath-tools tests: add tests for shared pointer code
libmultipath: remove libcheck_thread related code
libmultipath: use shared_ptr for checker classes
libmultipath: use shared_ptr for prioritizers
libmpathutil: runner: use shared_ptr
libmultipath: add generic async path checker code
libmultipath: checkers: add support for async checker
libmultipath: convert TUR checker to an async checker instance
libmultipath: convert cciss_tur checker to async checker
libmultipath: convert readsector0 checker to async checker
libmultipath: convert hp_sw checker to async checker
libmultipath: async_checker: add context_size and init symbols
libmultipath: convert RDAC checker to async checker
libmultipath: checkers: rework mpcontext passing
libmultipath: convert emc_clariion to async_checker
fixup "GitHub workflows: upload log files in case of failure"
multipath-tools tests: add wrapper for fstat() and fstat64()
libmpathutil: runner: avoid segmentation violation in pthread_cancel()
libmpathutil: runner: pause in cleanup handler if rctx is NULL
libmpathutil: runner: use pthread_cleanup_push()
multipath-tools tests: add unit test for reading GPT partition table
kpartx: Fix integer overflow in GPT size calculation
kpartx: use mmap() to implement alloc_read_gpt_entries()
kpartx: dasd: avoid out-of-bounds write in read_dasd_pt()
kpartx: dasd: avoid infinite loop in read_dasd_pt
kpartx: dasd: double check blocksize bounds after reading it from disk
kpartx: dasd: avoid negative partition size
.clang-format: set Cpp11BracedListStyle: false
Makefile: check for availablity of memfd_create()
multipath-tools Makefile: collect core dumps in test-outputs.tar
multipath-tools tests: enable coredumps when running tests
multipath-tools tests: use ioctl_request_t for all ioctl calls
multipath-tools tests: runner: avoid releasing context twice
multipath-tools tests: runner: fix wrong output for noise interval
multipath-tools tests: runner: avoid memory leaks by waiting for threads
multipath-tools tests: runner-test.sh: Check if libasan is enabled
multipath-tools tests: runner-test.sh: further shorten test runtime
GitHub workflows: remove spelling action
GitHub workflows: replace @mosteo-actions/docker-run with docker commands
GitHub workflows: set coredump pattern
GitHub workflows: make sure core dumps can be uploaded
GitHub workflows: rolling: use run: docker instead of container workflow
GitHub workflows: multiarch: use ARM runner for ARM arches
GitHub Workflows: run multiarch test on "musl" branch
multipath.conf.in: Update path_checker and force_sync documentation
multipath-tools: update NEWS.md
.clang-format: avoid reformatting comments
multipath-tools tests: fix code formatting in vpd.c
Fix minor code formatting issues in latest commits
Update NEWS.md
GitHub workflows: fix conditions in foreign.yaml
Add github workflows (pre-0.15) on new orphan branch
GitHub workflows: replace actions/checkout@v4 with @v7
GitHub workflows: replace setup-qemu-action@v2 with @v4
Add dependabot.yml for tracking github action updates
Add dependabot.yml for tracking github action updates
Merge branch 'workflows' into queue
Merge branch 'workflows' into queue
libmultipath: bump version to 0.15.0
libmultipath: iet prioritizer: obtain PATH_ID from udev
Update NEWS.md
@xosevp (11):
multipath-tools: add missing colon to the multipath output
multipath-tools: identify the hds.c licence explicitly
multipath-tools: align ALUA state strings with kernel scsi_sysfs
multipath-tools: delete obsolete information from multipath.conf.5
multipath-tools: remove explicit width from .TP macros in multipath.conf.5
multipath-tools: remove explicit widths from macros in the remaining man pages
multipath-tools: remove syntax check comments from man pages
multipath-tools: clarify path selector descriptions in multipath.conf.5
multipath-tools: specify file paths using variables and add FILES section in multipath.conf.5
multipath-tools: clarify user_friendly_names prefix behavior in multipath.conf.5
multipath-tools: fix mandoc errors/warnings in man pages
dependabot[bot] (4):
GitHub workflows [dependabot]: Bump actions/upload-artifact from 4 to 7
GitHub workflows [dependabot]: Bump actions/checkout from 4 to 7
GitHub workflows [dependabot]: Bump actions/download-artifact
GitHub workflows [dependabot]: Bump dawidd6/action-download-artifact
Cc: @ahvlima, still waiting for feedback on #145.