On Fri, Feb 25, 2005 at 06:57:39AM -0500, Doug Ledford wrote: > On Fri, 2005-02-25 at 03:38 -0500, Jeff Garzik wrote: > > Arjan van de Ven wrote: > > > On Thu, 2005-02-24 at 23:21 -0500, Doug Ledford wrote: > > > > > >>Don't use cmd->request->nr_hw_segments as it may not be initialized > > >>(SG_IO in particular bypasses anything that initializes this and just > > >>uses scsi_do_req to insert a scsi_request directly on the head of the > > >>queue) > > > > > > > > > should we fix that in the SG_IO layer ? > > > > Possibly/probably.
Doug, What kernel did you hit this with? And same question as Doug G: is it via sg (not the block SG_IO)? sg uses scsi_do_req(), block SG_IO doesn't. Jens sent changes last August or so that fixed SG_IO (not sg) to always set nr_hw_segments, change should be in 2.6.10. It is not obvious that his change fixed this, I can't find the changeset or log. > I'm not concerned with it personally. The only reason that the scsi > layer copies the block layer request struct into the scsi > command/request is so that upon completion it has enough information to > mark blocks as either up to date or not while at the same time allowing > the scsi layer to free the original block request at queue time, not at > completion time. It was never intended to be used by low level drivers. In 2.6, we no don't copy the request into the command: struct scsi_cmnd { ... struct request *request ... } -- Patrick Mansfield - To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html