[dm-devel] [PATCH 3/5] libmultipath: pathinfo: skip hidden devices
Benjamin Marzinski
bmarzins at redhat.com
Fri Sep 21 22:52:10 UTC 2018
On Fri, Sep 14, 2018 at 02:51:01PM +0200, Martin Wilck wrote:
Reviewed-by: Benjamin Marzinski <bmarzins at redhat.com>
> Hidden block devices (in practice: members of nvme native multipath
> devices) can't be used by multipath anyway. Current multipath code
> (with default blacklisting) skips them, too, but emits a misleading
> "blacklisted: udev property missing" message.
>
> Signed-off-by: Martin Wilck <mwilck at suse.com>
> ---
> libmultipath/discovery.c | 15 ++++++++++++---
> 1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
> index 0b1855dd..11da64ba 100644
> --- a/libmultipath/discovery.c
> +++ b/libmultipath/discovery.c
> @@ -1858,9 +1858,18 @@ int pathinfo(struct path *pp, struct config *conf, int mask)
> * limited by DI_BLACKLIST and occurs before this debug
> * message with the mask value.
> */
> - if (pp->udev && (is_claimed_by_foreign(pp->udev) ||
> - filter_property(conf, pp->udev) > 0))
> - return PATHINFO_SKIPPED;
> + if (pp->udev) {
> + const char *hidden =
> + udev_device_get_sysattr_value(pp->udev, "hidden");
> +
> + if (hidden && !strcmp(hidden, "1")) {
> + condlog(3, "%s: hidden", pp->dev);
> + return PATHINFO_SKIPPED;
> + }
> + if (is_claimed_by_foreign(pp->udev) ||
> + filter_property(conf, pp->udev) > 0)
> + return PATHINFO_SKIPPED;
> + }
>
> if (filter_devnode(conf->blist_devnode,
> conf->elist_devnode,
> --
> 2.18.0
More information about the dm-devel
mailing list