All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Marzinski <bmarzins@redhat.com>
To: Martin Wilck <martin.wilck@suse.com>
Cc: Christophe Varoqui <christophe.varoqui@opensvc.com>,
	device-mapper development <dm-devel@lists.linux.dev>
Subject: Re: [PATCH] libmultipath: Handle SCSI-2 style vpd page 0x83 descriptors
Date: Mon, 13 Apr 2026 12:15:47 -0400	[thread overview]
Message-ID: <ad0Wsx2Af_Sh5RxB@redhat.com> (raw)
In-Reply-To: <6fe5f3fc3894f2227a4ebda322256580fb4711c8.camel@suse.com>

On Mon, Apr 13, 2026 at 01:11:33PM +0200, Martin Wilck wrote:
> On Thu, 2026-03-26 at 23:41 -0400, Benjamin Marzinski wrote:
> > 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>
> > ---
> >  libmultipath/discovery.c | 13 +++++++++
> >  tests/vpd.c              | 58
> > ++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 71 insertions(+)
> > 
> > diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
> > index 0efb8213..057ff45f 100644
> > --- a/libmultipath/discovery.c
> > +++ b/libmultipath/discovery.c
> > @@ -1208,6 +1208,18 @@ parse_vpd_pg83(const unsigned char *in, size_t
> > in_len,
> >  	if (out_len <= 1)
> >  		return 0;
> >  
> > +	/*
> > +	 * Not a valid SPC-2/3 vpd page 83. Assume it's a SCSI-2
> > style
> > +	 * descriptor.
> > +	 */
> > +	if (in[6] != 0) {
> 
> Make sure that if in_len is > 6 (or actually, large enough to hold the
> SCSI-2 ID)?
>  

Good call.

-Ben

> > +		len = 0;
> > +		vpd_type = 0x3;
> > +		vpd_len = in_len - 4;
> > +		vpd = in + 4;
> > +		goto decode;
> > +	}
> > +
> 
> Regards,
> Martin


      reply	other threads:[~2026-04-13 16:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-27  3:41 [PATCH] libmultipath: Handle SCSI-2 style vpd page 0x83 descriptors Benjamin Marzinski
2026-04-07  9:14 ` Xose Vazquez Perez
2026-04-07 15:13   ` Benjamin Marzinski
2026-04-13 11:11 ` Martin Wilck
2026-04-13 16:15   ` Benjamin Marzinski [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=ad0Wsx2Af_Sh5RxB@redhat.com \
    --to=bmarzins@redhat.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=martin.wilck@suse.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.