From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Bottomley Subject: Re: [PATCH] libsas: User mode app failed to send ioctl commands to SATA drive. Date: Fri, 16 Jan 2009 09:21:05 -0500 Message-ID: <1232115665.3224.8.camel@localhost.localdomain> References: <496B1B31.4050606@marvell.com> <1231774426.3256.2.camel@localhost.localdomain> <49707B7A.90100@garzik.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: Received: from accolon.hansenpartnership.com ([76.243.235.52]:45272 "EHLO accolon.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936088AbZAPOVJ (ORCPT ); Fri, 16 Jan 2009 09:21:09 -0500 In-Reply-To: <49707B7A.90100@garzik.org> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: Jeff Garzik Cc: kewei@marvell.com, linux-scsi@vger.kernel.org, djwong@us.ibm.com, Jason Chu , Michael Wang , Jacky Feng On Fri, 2009-01-16 at 07:20 -0500, Jeff Garzik wrote: > James Bottomley wrote: > > On Mon, 2009-01-12 at 18:28 +0800, Ke Wei wrote: > >> The context of scsi_host's hostdata points to a sas ha structure with libsas > >> module, but the libata casts this pointer to a ata_port structure when ioctl > >> sends HDIO_GET_IDENTITY. > > > > This is a good find thanks. I think there's a small problem in the way > > the layering is done. > > > > I think ata_scsi_ioctl needs to be expanded to pass the port in all the > > time. That way other implementors don't have to remember to special > > case HDIO_GET_IDENTITY. > > > > When you redo this, ipr will need altering as well (rather than also > > having the identity exception added). > > The attached appears to be what is needed. We cannot change > ata_scsi_ioctl() because every libata driver uses that function directly > in its SCSI template as the driver's ioctl hook. > > Ack, and I'll apply? That's about precisely what I was thinking ... except I'd call the API ata_sas_scsi_ioctl() ... since the ata_sas prefix is what we use for all the SAS inputs to libata (and __ usually implies hidden or unlocked). I'll ack either way. James