linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.13] scsi: sd fails to copy cmd_len on SG_IO
@ 2005-09-13 17:39 Timothy Thelin
  2005-09-13 17:48 ` Mike Christie
  0 siblings, 1 reply; 4+ messages in thread
From: Timothy Thelin @ 2005-09-13 17:39 UTC (permalink / raw)
  To: James Bottomley, SCSI Mailing List; +Cc: Linux Kernel, Andrew Morton

This fixes an issue when doing SG_IO on an sd device: the
sd driver fails to copy the request's cmd_len to the scsi
command's cmd_len when initializing the command.

Signed-off-by: Timothy Thelin <timothy.thelin@wdc.com>

--- linux-2.6.13.orig/drivers/scsi/sd.c	2005-08-28 16:41:01.000000000 -0700
+++ linux-2.6.13/drivers/scsi/sd.c	2005-09-13 09:39:06.000000000 -0700
@@ -236,6 +236,7 @@ static int sd_init_command(struct scsi_c
 			return 0;
 
 		memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd));
+		SCpnt->cmd_len = rq->cmd_len;
 		if (rq_data_dir(rq) == WRITE)
 			SCpnt->sc_data_direction = DMA_TO_DEVICE;
 		else if (rq->data_len)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.13] scsi: sd fails to copy cmd_len on SG_IO
  2005-09-13 17:39 [PATCH 2.6.13] scsi: sd fails to copy cmd_len on SG_IO Timothy Thelin
@ 2005-09-13 17:48 ` Mike Christie
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Christie @ 2005-09-13 17:48 UTC (permalink / raw)
  To: Timothy Thelin
  Cc: James Bottomley, SCSI Mailing List, Linux Kernel, Andrew Morton

Timothy Thelin wrote:
> This fixes an issue when doing SG_IO on an sd device: the
> sd driver fails to copy the request's cmd_len to the scsi
> command's cmd_len when initializing the command.
> 

Do you need the same fix to st, sr, and scsi_lib (in the 
scsi_generic_done path)?

> Signed-off-by: Timothy Thelin <timothy.thelin@wdc.com>
> 
> --- linux-2.6.13.orig/drivers/scsi/sd.c	2005-08-28 16:41:01.000000000 -0700
> +++ linux-2.6.13/drivers/scsi/sd.c	2005-09-13 09:39:06.000000000 -0700
> @@ -236,6 +236,7 @@ static int sd_init_command(struct scsi_c
>  			return 0;
>  
>  		memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd));
> +		SCpnt->cmd_len = rq->cmd_len;
>  		if (rq_data_dir(rq) == WRITE)
>  			SCpnt->sc_data_direction = DMA_TO_DEVICE;
>  		else if (rq->data_len)
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH 2.6.13] scsi: sd fails to copy cmd_len on SG_IO
@ 2005-09-13 18:26 Timothy Thelin
  2005-09-13 19:05 ` Mike Christie
  0 siblings, 1 reply; 4+ messages in thread
From: Timothy Thelin @ 2005-09-13 18:26 UTC (permalink / raw)
  To: Mike Christie
  Cc: James Bottomley, SCSI Mailing List, Linux Kernel, Andrew Morton



> -----Original Message-----
> From: Mike Christie [mailto:michaelc@cs.wisc.edu]
> Sent: Tuesday, September 13, 2005 10:49 AM
> To: Timothy Thelin
> Cc: James Bottomley; SCSI Mailing List; Linux Kernel; Andrew Morton
> Subject: Re: [PATCH 2.6.13] scsi: sd fails to copy cmd_len on SG_IO
> 
> 
> Timothy Thelin wrote:
> > This fixes an issue when doing SG_IO on an sd device: the
> > sd driver fails to copy the request's cmd_len to the scsi
> > command's cmd_len when initializing the command.
> > 
> 
> Do you need the same fix to st, sr, and scsi_lib (in the 
> scsi_generic_done path)?
> 

I just looked, and st and sr look like they need the same fix, but i'm
unaware of where scsi_lib might need it (I'm new to the Linux scsi stack).
Mind elaborating on your thoughts of the scsi_generic_done path? (I cant
find
the symbol in drivers/scsi/*)


> > Signed-off-by: Timothy Thelin <timothy.thelin@wdc.com>
> > 
> > --- linux-2.6.13.orig/drivers/scsi/sd.c	2005-08-28 
> 16:41:01.000000000 -0700
> > +++ linux-2.6.13/drivers/scsi/sd.c	2005-09-13 
> 09:39:06.000000000 -0700
> > @@ -236,6 +236,7 @@ static int sd_init_command(struct scsi_c
> >  			return 0;
> >  
> >  		memcpy(SCpnt->cmnd, rq->cmd, sizeof(SCpnt->cmnd));
> > +		SCpnt->cmd_len = rq->cmd_len;
> >  		if (rq_data_dir(rq) == WRITE)
> >  			SCpnt->sc_data_direction = DMA_TO_DEVICE;
> >  		else if (rq->data_len)
> > -
> > To unsubscribe from this list: send the line "unsubscribe 
> linux-scsi" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2.6.13] scsi: sd fails to copy cmd_len on SG_IO
  2005-09-13 18:26 Timothy Thelin
@ 2005-09-13 19:05 ` Mike Christie
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Christie @ 2005-09-13 19:05 UTC (permalink / raw)
  To: Timothy Thelin
  Cc: James Bottomley, SCSI Mailing List, Linux Kernel, Andrew Morton

Timothy Thelin wrote:
> 
>>-----Original Message-----
>>From: Mike Christie [mailto:michaelc@cs.wisc.edu]
>>Sent: Tuesday, September 13, 2005 10:49 AM
>>To: Timothy Thelin
>>Cc: James Bottomley; SCSI Mailing List; Linux Kernel; Andrew Morton
>>Subject: Re: [PATCH 2.6.13] scsi: sd fails to copy cmd_len on SG_IO
>>
>>
>>Timothy Thelin wrote:
>>
>>>This fixes an issue when doing SG_IO on an sd device: the
>>>sd driver fails to copy the request's cmd_len to the scsi
>>>command's cmd_len when initializing the command.
>>>
>>
>>Do you need the same fix to st, sr, and scsi_lib (in the 
>>scsi_generic_done path)?
>>
> 
> 
> I just looked, and st and sr look like they need the same fix, but i'm
> unaware of where scsi_lib might need it (I'm new to the Linux scsi stack).
> Mind elaborating on your thoughts of the scsi_generic_done path? (I cant
> find
> the symbol in drivers/scsi/*)
> 

look at the bottom of scsi_prep_fn() in scsi_lib.c. SCSI-ml will do 
block_pc commands (which come down like block layer SG_IO ones) for 
things like inquiry and report luns when scanning a host. At that time 
there is no upper layer driver like sd attached so scsi_generic_done() 
is used as a callback for finishing up commands.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-13 19:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-13 17:39 [PATCH 2.6.13] scsi: sd fails to copy cmd_len on SG_IO Timothy Thelin
2005-09-13 17:48 ` Mike Christie
  -- strict thread matches above, loose matches on Subject: below --
2005-09-13 18:26 Timothy Thelin
2005-09-13 19:05 ` Mike Christie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).