Skip to content

consistent behavior of filter_property()

[email protected] dm-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3pathinfo: call filter_property() after sysfs_pathinfo()libmultipath/discovery.c libmultipath/valid.c tests/Makefile +2 more+105 -180 replies
2/3libmultipath: pathinfo: call filter_property only with DI_BLACKLISTlibmultipath/discovery.c tests/test-lib.c+15 -180 replies
3/3multipath -w: allow removing blacklisted pathslibmultipath/configure.c+2 -20 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchBenjamin Marzinski
SeriesR-b
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [dm-devel] [PATCH 0/3] consistent behavior of filter_property()

From: Martin Wilck <[email protected]>

This is a spring-off of the previous discussion under the subject "libmultipath: fix NULL dereference in get_be64".

Repeating part of the text of my last post there:

pp->uid_attribute may be set from the hwtable, which
means that vendor/product must be known, which in turn means that uid_attribute can't be set correctly before sysfs_pathinfo() is run. Thus, in order to be consistent, we need to move the filter_property() further down in pathinfo(), after the call to sysfs_pathinfo().

However, that has a side effect. As Ben already stated, pp->uid_attribute currently is *never* set the first time the call chain pathinfo()->filter_property() is run. After the proposed change, it would *always* be set in this call chain, possibly leading to more cases where pathinfo returns PATHINFO_SKIPPED.

This matters e.g. for "multipath -w". When we remove a WWID, we must be sure get_refwwid() fills in the wwid, which won't happen if PATHINFO_SKIPPED is returned.

(While looking at this, I discovered that it didn't work in current upstream either. I guess it has been broken since 0.6.0, or 355291b ("libmultipath: filter for missing property in get_refwwid()" This lead to the addition of patch 3/3).

In order not to break such use cases, we need to make the filter_property() test in pathinfo() dependent on DI_BLACKLIST. That would make a lot of sense, but it'd cause a semantic change.

Comments welcome.

Regards
Martin

Martin Wilck (3):
pathinfo: call filter_property() after sysfs_pathinfo()
libmultipath: pathinfo: call filter_property only with DI_BLACKLIST multipath -w: allow removing blacklisted paths

 libmultipath/configure.c |  4 +-
 libmultipath/discovery.c | 19 +++++++--
 libmultipath/valid.c     |  4 --
 tests/Makefile           |  2 +-
 tests/test-lib.c         | 18 ++++----
 tests/valid.c            | 91 ++++++++++++++++++++++++++++++++++++----
 6 files changed, 111 insertions(+), 27 deletions(-)
Signature · 7 lines
2.29.2


--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel