public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] 2.5.67+ scsi_release_request call queue next
@ 2003-04-15  6:33 Mike Anderson
  2003-04-15 15:01 ` Trivial patch for scsi logging text string Alan Stern
  2003-04-15 19:39 ` [PATCH] 2.5.67+ scsi_release_request call queue next Alan Stern
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Anderson @ 2003-04-15  6:33 UTC (permalink / raw)
  To: linux-scsi; +Cc: stern

This patch is against 2.5.67 as of 04-14 as it needs extern for
scsi_queue_next_request.

I just compiled and booted this patch. I currently do not have a setup to
check door lock post error recovery.

-andmike
--
Michael Anderson
andmike@us.ibm.com


DESC
The patch adds a call to scsi_queue_next_request from scsi_release_request. It
also removes a call in scsi_eh_lock_done to scsi_put_command.
scsi_release_request will do a call to scsi_put_command if needed.
EDESC


 drivers/scsi/scsi.c       |    2 ++
 drivers/scsi/scsi_error.c |    4 ----
 2 files changed, 2 insertions(+), 4 deletions(-)

diff -puN drivers/scsi/scsi.c~scsi-release-req drivers/scsi/scsi.c
--- sysfs-bleed-2.5/drivers/scsi/scsi.c~scsi-release-req	Mon Apr 14 15:34:14 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/scsi.c	Mon Apr 14 15:34:14 2003
@@ -224,8 +224,10 @@ void scsi_release_request(Scsi_Request *
 {
 	if( req->sr_command != NULL )
 	{
+    		request_queue_t *q = req->sr_device->request_queue;
 		scsi_put_command(req->sr_command);
 		req->sr_command = NULL;
+		scsi_queue_next_request(q, NULL);
 	}
 
 	kfree(req);
diff -puN drivers/scsi/scsi_error.c~scsi-release-req drivers/scsi/scsi_error.c
--- sysfs-bleed-2.5/drivers/scsi/scsi_error.c~scsi-release-req	Mon Apr 14 15:34:14 2003
+++ sysfs-bleed-2.5-andmike/drivers/scsi/scsi_error.c	Mon Apr 14 15:34:14 2003
@@ -1334,10 +1334,6 @@ static void scsi_eh_lock_done(struct scs
 {
 	struct scsi_request *sreq = scmd->sc_request;
 
-	scmd->sc_request = NULL;
-	sreq->sr_command = NULL;
-
-	scsi_put_command(scmd);
 	scsi_release_request(sreq);
 }
 

_

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

* Trivial patch for scsi logging text string
  2003-04-15  6:33 [PATCH] 2.5.67+ scsi_release_request call queue next Mike Anderson
@ 2003-04-15 15:01 ` Alan Stern
  2003-04-15 17:03   ` Greg KH
  2003-04-15 19:39 ` [PATCH] 2.5.67+ scsi_release_request call queue next Alan Stern
  1 sibling, 1 reply; 8+ messages in thread
From: Alan Stern @ 2003-04-15 15:01 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-scsi

Greg:

This patch fixes a very minor bobble in a kernel logging string (excess 
blank space following the \n).  Please apply.

Alan Stern

--- 1.34/drivers/scsi/scsi_lib.c	Mon Apr  7 06:33:23 2003
+++ edited/drivers/scsi/scsi_lib.c	Tue Apr 15 10:58:22 2003
@@ -703,7 +703,7 @@
 	if (good_sectors >= 0) {
 		SCSI_LOG_HLCOMPLETE(1, printk("%ld sectors total, %d sectors done.\n",
 					      req->nr_sectors, good_sectors));
-		SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n ", cmd->use_sg));
+		SCSI_LOG_HLCOMPLETE(1, printk("use_sg is %d\n", cmd->use_sg));
 
 		if (clear_errors)
 			req->errors = 0;


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

* Re: Trivial patch for scsi logging text string
  2003-04-15 15:01 ` Trivial patch for scsi logging text string Alan Stern
@ 2003-04-15 17:03   ` Greg KH
  2003-04-15 17:10     ` James Bottomley
  0 siblings, 1 reply; 8+ messages in thread
From: Greg KH @ 2003-04-15 17:03 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-scsi

On Tue, Apr 15, 2003 at 11:01:31AM -0400, Alan Stern wrote:
> Greg:
> 
> This patch fixes a very minor bobble in a kernel logging string (excess 
> blank space following the \n).  Please apply.
> 
> Alan Stern
> 
> --- 1.34/drivers/scsi/scsi_lib.c	Mon Apr  7 06:33:23 2003
> +++ edited/drivers/scsi/scsi_lib.c	Tue Apr 15 10:58:22 2003

Hm, I don't think I can submit scsi patches to Linus :)
Why not send them to the scsi maintainers...

thanks,

greg k-h

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

* Re: Trivial patch for scsi logging text string
  2003-04-15 17:03   ` Greg KH
@ 2003-04-15 17:10     ` James Bottomley
  2003-04-15 19:31       ` Alan Stern
  0 siblings, 1 reply; 8+ messages in thread
From: James Bottomley @ 2003-04-15 17:10 UTC (permalink / raw)
  To: Greg KH; +Cc: Alan Stern, SCSI Mailing List

On Tue, 2003-04-15 at 12:03, Greg KH wrote:
> Hm, I don't think I can submit scsi patches to Linus :)
> Why not send them to the scsi maintainers...

The SCSI maintainers are linux-scsi@vger.kernel.org, so we've already
been copied on this one.

James



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

* Re: Trivial patch for scsi logging text string
  2003-04-15 17:10     ` James Bottomley
@ 2003-04-15 19:31       ` Alan Stern
  2003-04-15 21:42         ` James Bottomley
  0 siblings, 1 reply; 8+ messages in thread
From: Alan Stern @ 2003-04-15 19:31 UTC (permalink / raw)
  To: James Bottomley; +Cc: Greg KH, SCSI Mailing List

On 15 Apr 2003, James Bottomley wrote:

> On Tue, 2003-04-15 at 12:03, Greg KH wrote:
> > Hm, I don't think I can submit scsi patches to Linus :)
> > Why not send them to the scsi maintainers...
> 
> The SCSI maintainers are linux-scsi@vger.kernel.org, so we've already
> been copied on this one.
> 
> James

Does that mean that linux-scsi will forward my patch to Linus?  I hope so,
because I've got another one to submit (to Marcelo), more substantive this
time.

In 2.4.21-pre7, when the scsi error-handler decides that it has cleaned 
things up and retries the original command, it neglects to zero out the 
command's sense buffer first.  In all likelihood the sense buffer will 
contain old data left over from the error recovery operations.  This 
confuses scan_scsis(), which thinks that because there is valid sense data 
its INQUIRY probe must have failed.  This patch clears the sense buffer 
before a retry.

If nobody on the linux-scsi list objects to it, this patch should be 
applied.

Alan Stern


--- 2.4.21-pre7/drivers/scsi/scsi_error.c.orig	Tue Apr 15 11:18:35 2003
+++ 2.4.21-pre7/drivers/scsi/scsi_error.c	Tue Apr 15 11:19:29 2003
@@ -393,6 +393,7 @@
 	SCpnt->cmd_len = SCpnt->old_cmd_len;
 	SCpnt->sc_data_direction = SCpnt->sc_old_data_direction;
 	SCpnt->underflow = SCpnt->old_underflow;
+	memset(SCpnt->sense_buffer, 0, sizeof(SCpnt->sense_buffer));
 
 	scsi_send_eh_cmnd(SCpnt, SCpnt->timeout_per_command);
 


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

* Re: [PATCH] 2.5.67+ scsi_release_request call queue next
  2003-04-15  6:33 [PATCH] 2.5.67+ scsi_release_request call queue next Mike Anderson
  2003-04-15 15:01 ` Trivial patch for scsi logging text string Alan Stern
@ 2003-04-15 19:39 ` Alan Stern
  2003-04-15 22:36   ` Mike Anderson
  1 sibling, 1 reply; 8+ messages in thread
From: Alan Stern @ 2003-04-15 19:39 UTC (permalink / raw)
  To: Mike Anderson; +Cc: linux-scsi

On Mon, 14 Apr 2003, Mike Anderson wrote:

> This patch is against 2.5.67 as of 04-14 as it needs extern for
> scsi_queue_next_request.
> 
> I just compiled and booted this patch. I currently do not have a setup to
> check door lock post error recovery.

Mike:

I just tried your patch.  I had to make scsi_queue_next_request() 
non-static to get things to link properly, but after doing so it seemed to 
work just fine.  After the door-lock command finished, the request queue 
moved right along and all the data was transferred correctly.

Thanks.

Alan Stern




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

* Re: Trivial patch for scsi logging text string
  2003-04-15 19:31       ` Alan Stern
@ 2003-04-15 21:42         ` James Bottomley
  0 siblings, 0 replies; 8+ messages in thread
From: James Bottomley @ 2003-04-15 21:42 UTC (permalink / raw)
  To: Alan Stern; +Cc: Greg KH, SCSI Mailing List

On Tue, 2003-04-15 at 14:31, Alan Stern wrote:
> On 15 Apr 2003, James Bottomley wrote:
> 
> > On Tue, 2003-04-15 at 12:03, Greg KH wrote:
> > > Hm, I don't think I can submit scsi patches to Linus :)
> > > Why not send them to the scsi maintainers...
> > 
> > The SCSI maintainers are linux-scsi@vger.kernel.org, so we've already
> > been copied on this one.
> > 
> > James
> 
> Does that mean that linux-scsi will forward my patch to Linus?  I hope so,
> because I've got another one to submit (to Marcelo), more substantive this
> time.

Yes, for 2.5

> In 2.4.21-pre7, when the scsi error-handler decides that it has cleaned 
> things up and retries the original command, it neglects to zero out the 
> command's sense buffer first.  In all likelihood the sense buffer will 
> contain old data left over from the error recovery operations.  This 
> confuses scan_scsis(), which thinks that because there is valid sense data 
> its INQUIRY probe must have failed.  This patch clears the sense buffer 
> before a retry.
> 
> If nobody on the linux-scsi list objects to it, this patch should be 
> applied.

2.4 is more tricky.  Since fixing 2.5 is pretty much a full time job,
there's no-one really who looks after SCSI in 2.4.  It's probably best
to send it to Marcelo along with an explanation of what the problem is.

James



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

* Re: [PATCH] 2.5.67+ scsi_release_request call queue next
  2003-04-15 19:39 ` [PATCH] 2.5.67+ scsi_release_request call queue next Alan Stern
@ 2003-04-15 22:36   ` Mike Anderson
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Anderson @ 2003-04-15 22:36 UTC (permalink / raw)
  To: Alan Stern; +Cc: linux-scsi

Alan Stern [stern@rowland.harvard.edu] wrote:
> Mike:
> 
> I just tried your patch.  I had to make scsi_queue_next_request() 
> non-static to get things to link properly, but after doing so it seemed to 
> work just fine.  After the door-lock command finished, the request queue 
> moved right along and all the data was transferred correctly.

Good to see it worked. The non-static change should be in the bk current
tree already.

-andmike
--
Michael Anderson
andmike@us.ibm.com


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

end of thread, other threads:[~2003-04-15 22:22 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-15  6:33 [PATCH] 2.5.67+ scsi_release_request call queue next Mike Anderson
2003-04-15 15:01 ` Trivial patch for scsi logging text string Alan Stern
2003-04-15 17:03   ` Greg KH
2003-04-15 17:10     ` James Bottomley
2003-04-15 19:31       ` Alan Stern
2003-04-15 21:42         ` James Bottomley
2003-04-15 19:39 ` [PATCH] 2.5.67+ scsi_release_request call queue next Alan Stern
2003-04-15 22:36   ` Mike Anderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox