From owner-freebsd-scsi@FreeBSD.ORG Tue Apr 9 19:43:08 2013 Return-Path: Delivered-To: FreeBSD-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C91E427F; Tue, 9 Apr 2013 19:43:08 +0000 (UTC) (envelope-from seanwbruno@gmail.com) Received: from mail-pd0-f178.google.com (mail-pd0-f178.google.com [209.85.192.178]) by mx1.freebsd.org (Postfix) with ESMTP id 99F2B86D; Tue, 9 Apr 2013 19:43:08 +0000 (UTC) Received: by mail-pd0-f178.google.com with SMTP id w11so3912092pde.9 for ; Tue, 09 Apr 2013 12:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:subject:from:reply-to:to:cc:in-reply-to:references :content-type:date:message-id:mime-version:x-mailer; bh=z3oz4woafSRsUqvy01aQ9ybRhaqHzXP9G3xdGHWiTvg=; b=WxIuuH4iZrYDdn/auaAgHEVaV0hSXc3/gr4DYzxYd3LHi0wshLCQHvD6b5wIx4qCPj kXPsGCaXdiW06AaxWUCSxFtIsorAZ22n7Y4VyRYNNBaOKk0ZxNCk/9TZkt6s54T6SOSz KfOCMUdtIYy+cLp7AP82SXpGPEWhMQDDPYUV8Geq1SzCcMm/our76NQaQy0RfRDV7ce/ gPnQuOkft0KwqDjFWV9CD9P1uJkwPUXGR8vE28C/H0uaonpeMpGBgzJ6Ckkmdn5fFZj1 u5r/P8/NwtyGaqZFHpmNaktU/mf3sCGIS7SeF7nN7HlhGK4EccfXJ4NDWaYzWmu1DBVx 8U9Q== X-Received: by 10.67.1.4 with SMTP id bc4mr24884084pad.109.1365536582418; Tue, 09 Apr 2013 12:43:02 -0700 (PDT) Received: from [10.73.160.242] (nat-dip7.cfw-a-gci.corp.yahoo.com. [209.131.62.116]) by mx.google.com with ESMTPS id xl10sm47700236pac.15.2013.04.09.12.42.59 (version=SSLv3 cipher=RC4-SHA bits=128/128); Tue, 09 Apr 2013 12:43:00 -0700 (PDT) Subject: Re: ciss(4) malformed vendor/product data From: Sean Bruno To: sbruno@freebsd.org In-Reply-To: <1365452066.2312.30.camel@localhost> References: <1365452066.2312.30.camel@localhost> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-Mr3RKsHVQJnL37Z+N4/q" Date: Tue, 09 Apr 2013 12:42:58 -0700 Message-ID: <1365536578.2158.4.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Cc: "FreeBSD-scsi@freebsd.org" X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: sbruno@freebsd.org List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2013 19:43:08 -0000 --=-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 > at scbus0 target 0 lun 0 (pass0,da0) > at scbus0 target 1 lun 0 (pass1,da1) > 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 > at scbus0 target 0 lun 0 (pass0,da0) > 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--