public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ibmvscsi: correct command abort logic
@ 2008-12-06 15:41 Robert Jennings
  2008-12-08 14:32 ` Brian King
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Jennings @ 2008-12-06 15:41 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, Brian King, Santiago Leon

The logic is swapped when we determine if a command that we're trying
to abort has already completed.  This will keep us from freeing event
structures at the correct time, fail to unmap command data properly 
and throw off our request_limit count.

Signed-off-by: Robert Jennings <rcjenn@us.ibm.com>

---

 ibmvscsi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 6cad175..2d9db9b 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -1099,7 +1099,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
 		}
 	}
 
-	if (found_evt == NULL) {
+	if (found_evt != NULL) {
 		spin_unlock_irqrestore(hostdata->host->host_lock, flags);
 		sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%lx completed\n",
 			    tsk_mgmt->task_tag);

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

* Re: [PATCH 1/1] ibmvscsi: correct command abort logic
  2008-12-06 15:41 [PATCH 1/1] ibmvscsi: correct command abort logic Robert Jennings
@ 2008-12-08 14:32 ` Brian King
  2008-12-08 20:49   ` Robert Jennings
  0 siblings, 1 reply; 3+ messages in thread
From: Brian King @ 2008-12-08 14:32 UTC (permalink / raw)
  To: Robert Jennings; +Cc: James.Bottomley, linux-scsi, Santiago Leon

I don't think this is right. This will inject an oops into the
found_evt == NULL path. Additionally, if the event is still on the
sent list, with this change, we leave it on the sent list. The
way I thought this was supposed to work was if we got back a successful
response to the abort command that implied that everything was cleaned
up for the command we were aborting, which is why we clean up after it
in the found_evt != NULL case.

-Brian

Robert Jennings wrote:
> The logic is swapped when we determine if a command that we're trying
> to abort has already completed.  This will keep us from freeing event
> structures at the correct time, fail to unmap command data properly 
> and throw off our request_limit count.
> 
> Signed-off-by: Robert Jennings <rcjenn@us.ibm.com>
> 
> ---
> 
>  ibmvscsi.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
> index 6cad175..2d9db9b 100644
> --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
> +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
> @@ -1099,7 +1099,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
>  		}
>  	}
> 
> -	if (found_evt == NULL) {
> +	if (found_evt != NULL) {
>  		spin_unlock_irqrestore(hostdata->host->host_lock, flags);
>  		sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%lx completed\n",
>  			    tsk_mgmt->task_tag);


-- 
Brian King
Linux on Power Virtualization
IBM Linux Technology Center



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

* Re: [PATCH 1/1] ibmvscsi: correct command abort logic
  2008-12-08 14:32 ` Brian King
@ 2008-12-08 20:49   ` Robert Jennings
  0 siblings, 0 replies; 3+ messages in thread
From: Robert Jennings @ 2008-12-08 20:49 UTC (permalink / raw)
  To: Brian King; +Cc: James.Bottomley, linux-scsi

My patch is wrong and the current code is correct, I wasn't following
the logic correctly.

--Rob

* Brian King (brking@linux.vnet.ibm.com) wrote:
> I don't think this is right. This will inject an oops into the
> found_evt == NULL path. Additionally, if the event is still on the
> sent list, with this change, we leave it on the sent list. The
> way I thought this was supposed to work was if we got back a successful
> response to the abort command that implied that everything was cleaned
> up for the command we were aborting, which is why we clean up after it
> in the found_evt != NULL case.
> 
> -Brian
> 
> Robert Jennings wrote:
> > The logic is swapped when we determine if a command that we're trying
> > to abort has already completed.  This will keep us from freeing event
> > structures at the correct time, fail to unmap command data properly 
> > and throw off our request_limit count.
> > 
> > Signed-off-by: Robert Jennings <rcjenn@us.ibm.com>
> > 
> > ---
> > 
> >  ibmvscsi.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
> > index 6cad175..2d9db9b 100644
> > --- a/drivers/scsi/ibmvscsi/ibmvscsi.c
> > +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
> > @@ -1099,7 +1099,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
> >  		}
> >  	}
> > 
> > -	if (found_evt == NULL) {
> > +	if (found_evt != NULL) {
> >  		spin_unlock_irqrestore(hostdata->host->host_lock, flags);
> >  		sdev_printk(KERN_INFO, cmd->device, "aborted task tag 0x%lx completed\n",
> >  			    tsk_mgmt->task_tag);
> 
> 
> -- 
> Brian King
> Linux on Power Virtualization
> IBM Linux Technology Center
> 
> 

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

end of thread, other threads:[~2008-12-08 20:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-06 15:41 [PATCH 1/1] ibmvscsi: correct command abort logic Robert Jennings
2008-12-08 14:32 ` Brian King
2008-12-08 20:49   ` Robert Jennings

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