All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: James Shoemaker <james@dhlake.com>, dm-devel@redhat.com
Subject: Re: libmultipath issue
Date: Tue, 13 Jun 2017 22:28:08 +0200	[thread overview]
Message-ID: <1497385688.4654.56.camel@suse.com> (raw)
In-Reply-To: <CALRmJ1uB6SA_ct7O-2XxQthWmXZpLhnJ0sAj3tc0kmTxkGu9LQ@mail.gmail.com>

Hi James,

On Tue, 2017-06-13 at 11:19 -0500, James Shoemaker wrote:
>    I have a piece of hardware, a 16 bay storagetek  optically
> connected SAN to
> be specific, that returns empty string for Device id.
> 
>    I did the following patch to resolve the issue, it basically
> allows empty
> string for vendor and product, I couldn't find anywhere that had an
> issue with
> it..
> 
> diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
> index 663c8ea..92d0e49 100644
> --- a/libmultipath/discovery.c
> +++ b/libmultipath/discovery.c
> @@ -1149,12 +1149,12 @@ scsi_sysfs_pathinfo (struct path * pp, vector
> hwtable)
>         if (!attr_path || pp->sg_id.host_no == -1)
>                 return 1;
> 
> -       if (sysfs_get_vendor(parent, pp->vendor_id, SCSI_VENDOR_SIZE)
> <= 0)
> +       if (sysfs_get_vendor(parent, pp->vendor_id, SCSI_VENDOR_SIZE)
> < 0)
>                 return 1;
> 
>         condlog(3, "%s: vendor = %s", pp->dev, pp->vendor_id);
> 
> -       if (sysfs_get_model(parent, pp->product_id,
> SCSI_PRODUCT_SIZE) <= 0)
> +       if (sysfs_get_model(parent, pp->product_id,
> SCSI_PRODUCT_SIZE) < 0)
>                 return 1;
> 
>         condlog(3, "%s: product = %s", pp->dev, pp->product_id);

In general, yes, I think this would work. vendor_id and product_id are
primarily used to lookup parameters in the hwtable, and there we have
no entries with empty vendor or product.

One side issue that needs to be considered is printout, though:
snprint_multipath_(vpr|prod|vend) will just print nothing if either
vendor or product has zero length. It would be good if they'd print
e.g. "<NOVNDR>" and "<NO PRODUCT>" instead.

Regards
Martin

PS: Patch in plain text format would be appreciated.

-- 
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

      reply	other threads:[~2017-06-13 20:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13 16:19 libmultipath issue James Shoemaker
2017-06-13 20:28 ` Martin Wilck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1497385688.4654.56.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=dm-devel@redhat.com \
    --cc=james@dhlake.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.