From mboxrd@z Thu Jan 1 00:00:00 1970 From: patman@aracnet.com Date: Fri, 06 Jan 2006 01:36:40 +0000 Subject: Re: /dev/disk/by-id incomplete and unhelpful for SATA drives Message-Id: <20060106013640.GA27841@aracnet.com> List-Id: References: <20051221185518.GA9100@vrfy.org> <43A9CFE0.2070103@edesix.com> <20051222043527.GA13175@vrfy.org> <43AA8D0B.10504@edesix.com> <20051222183525.GA17871@devserv.devel.redhat.com> <43AB40E2.1050009@edesix.com> In-Reply-To: <43AB40E2.1050009@edesix.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Chris Paulson-Ellis Cc: Bill Nottingham , linux-hotplug-devel@lists.sourceforge.net, linux-scsi@vger.kernel.org On Fri, Dec 23, 2005 at 12:12:18AM +0000, Chris Paulson-Ellis wrote: > >Why not just fix the kernel when it's filling in the page 83 > >data to pull the serial from page 80 instead of putting *that* there? > > > >Bill > > Indeed. Here's the patch. Now I have 3 ways to fix this. Any more anyone? This is the best approach, I think you could even remove page 0x83 support and still be SCSI compliant. You should add a sign-off and re-send the patch to linux-scsi (cc-ed here) and jeff garzik. What was scsi_id output before and after the patch? > --- drivers/scsi/libata-scsi.c.orig 2005-12-22 23:23:55.000000000 +0000 > +++ drivers/scsi/libata-scsi.c 2005-12-22 23:56:14.000000000 +0000 > @@ -1532,16 +1532,13 @@ > return 0; > } > > -static const char *inq_83_str = "Linux ATA-SCSI simulator"; > - > /** > * ata_scsiop_inq_83 - Simulate INQUIRY EVPD page 83, device identity > * @args: device IDENTIFY data / SCSI command of interest. > * @rbuf: Response buffer, to which simulated SCSI cmd output is sent. > * @buflen: Response buffer length. > * > - * Returns device identification. Currently hardcoded to > - * return "Linux ATA-SCSI simulator". > + * Returns ATA device serial number (as for page 80). > * > * LOCKING: > * spin_lock_irqsave(host_set lock) > @@ -1551,13 +1548,14 @@ > unsigned int buflen) > { > rbuf[1] = 0x83; /* this page code */ > - rbuf[3] = 4 + strlen(inq_83_str); /* page len */ > + rbuf[3] = 4 + ATA_SERNO_LEN; /* page len */ > > /* our one and only identification descriptor (vendor-specific) */ > - if (buflen > (strlen(inq_83_str) + 4 + 4 - 1)) { > + if (buflen > (ATA_SERNO_LEN + 4 + 4 - 1)) { > rbuf[4 + 0] = 2; /* code set: ASCII */ > - rbuf[4 + 3] = strlen(inq_83_str); > - memcpy(rbuf + 4 + 4, inq_83_str, strlen(inq_83_str)); > + rbuf[4 + 3] = ATA_SERNO_LEN; > + ata_dev_id_string(args->id, (unsigned char *) rbuf + 4 + 4, > + ATA_ID_SERNO_OFS, ATA_SERNO_LEN); -- Patrick Mansfield ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&op=click _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel