Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Apr 2013 12:42:58 -0700
From:      Sean Bruno <seanwbruno@gmail.com>
To:        sbruno@freebsd.org
Cc:        "FreeBSD-scsi@freebsd.org" <FreeBSD-scsi@freebsd.org>
Subject:   Re: ciss(4) malformed vendor/product data
Message-ID:  <1365536578.2158.4.camel@localhost>
In-Reply-To: <1365452066.2312.30.camel@localhost>
References:  <1365452066.2312.30.camel@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help

--=-Mr3RKsHVQJnL37Z+N4/q
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

On Mon, 2013-04-08 at 13:14 -0700, Sean Bruno wrote:
> I think, at some point in the mists of time, vendor and product inquiry
> were expand to 16bytes and 48 bytes respectively, at least when I look
> at camcontrol, that's what I see.
>=20
> I noted that the camcontrol devlist output was slightly mangled (note
> the lack of 1+0):
>=20
> -bash-4.2$ sudo camcontrol devlist
> <COMPAQ RAID 1(1VOLUME OK>         at scbus0 target 0 lun 0 (pass0,da0)
> <COMPAQ RAID 1(1VOLUME OK>         at scbus0 target 1 lun 0 (pass1,da1)
> <TEAC CD-224E 9.9A>                at scbus3 target 0 lun 0 (pass2,cd0)
>=20
> When I updated this to have the same padded sizes as camcontrol, then
> things realigned and became clear:
>=20
> <COMPAQ RAID 1(1+0) OK>            at scbus0 target 0 lun 0 (pass0,da0)
> <COMPAQ RAID 0 OK>                 at scbus0 target 1 lun 0 (pass1,da1)
>=20
>=20
> Not sure if there's a global that should be used here, or=20
>=20


Thought better of the patch, and thought, "Hey!  Why don't I just use
the values that CAM already defines for this purpose!"

This will have the same result as the previous version, but be slightly
more future proofish.

Index: ciss.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- ciss.c	(revision 249314)
+++ ciss.c	(working copy)
@@ -3346,9 +3346,12 @@
=20
 	cl =3D &sc->ciss_logical[bus][target];
=20
-	padstr(inq->vendor, "COMPAQ", 8);
-	padstr(inq->product,
ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance), 8);
-	padstr(inq->revision, ciss_name_ldrive_status(cl->cl_lstatus->status),
16);
+	padstr(inq->vendor, "COMPAQ",
+			SID_VENDOR_SIZE);
+	padstr(inq->product,
ciss_name_ldrive_org(cl->cl_ldrive->fault_tolerance),
+			SID_PRODUCT_SIZE);
+	padstr(inq->revision, ciss_name_ldrive_status(cl->cl_lstatus->status),
+			SID_REVISION_SIZE);
     }
 }


--=-Mr3RKsHVQJnL37Z+N4/q
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (FreeBSD)

iQEcBAABAgAGBQJRZG9CAAoJEBkJRdwI6BaHQoIH/1q8BJbsLgw7YdtRpZ/IPt+T
sTzImqz1FYxFx97E0o31l1r9t+ncF17EOSY+GIbBXaN0Gbn/zrZUPZAd7G6TqbrC
OrcOnoB9kUxYeR0XL8TrhTRVn13kXpxDZPHMNyrxEBhnOU0PIhKYw1FhVVA0NDZv
BVIjPInw8qIL/IU4HQ78ZNN0LV5PqqL+a6II7ZcQW1DMEuX3gXFgu47DrFrSJdDY
kT0LQv+G9DOjKKvydMjvOpFlMAqgNF6ExRwMGtbcvUFowIhtsABQ9rO9x9WaVmVs
zAkYnNDr2ZdDpFWdgJmTGVUY5chUIBSqZFDHz9T7t7wHxA4S/OP/beLYO8q8Kr0=
=mx8s
-----END PGP SIGNATURE-----

--=-Mr3RKsHVQJnL37Z+N4/q--




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1365536578.2158.4.camel>