[SCSI] qla2xxx: Correct eh_abort recovery logic.

Fix the driver to return SUCCESS if the firmware or driver doesn't
have a command to abort, i.e., it's already been returned. Without
this patch, error recovery will take the target offline as it tries
harder and harder to get the driver to return the command it no longer
has.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by Michael Reed and committed by James Bottomley 2ea00202 c005fb4f

+9 -6
+9 -6
drivers/scsi/qla2xxx/qla_os.c
··· 599 599 * Either SUCCESS or FAILED. 600 600 * 601 601 * Note: 602 + * Only return FAILED if command not returned by firmware. 602 603 **************************************************************************/ 603 604 int 604 605 qla2xxx_eh_abort(struct scsi_cmnd *cmd) ··· 610 609 unsigned int id, lun; 611 610 unsigned long serial; 612 611 unsigned long flags; 612 + int wait = 0; 613 613 614 614 if (!CMD_SP(cmd)) 615 - return FAILED; 615 + return SUCCESS; 616 616 617 - ret = FAILED; 617 + ret = SUCCESS; 618 618 619 619 id = cmd->device->id; 620 620 lun = cmd->device->lun; ··· 644 642 } else { 645 643 DEBUG3(printk("%s(%ld): abort_command " 646 644 "mbx success.\n", __func__, ha->host_no)); 647 - ret = SUCCESS; 645 + wait = 1; 648 646 } 649 647 spin_lock_irqsave(&ha->hardware_lock, flags); 650 648 ··· 653 651 spin_unlock_irqrestore(&ha->hardware_lock, flags); 654 652 655 653 /* Wait for the command to be returned. */ 656 - if (ret == SUCCESS) { 654 + if (wait) { 657 655 if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { 658 656 qla_printk(KERN_ERR, ha, 659 657 "scsi(%ld:%d:%d): Abort handler timed out -- %lx " 660 658 "%x.\n", ha->host_no, id, lun, serial, ret); 659 + ret = FAILED; 661 660 } 662 661 } 663 662 664 663 qla_printk(KERN_INFO, ha, 665 - "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no, 666 - id, lun, serial, ret); 664 + "scsi(%ld:%d:%d): Abort command issued -- %d %lx %x.\n", 665 + ha->host_no, id, lun, wait, serial, ret); 667 666 668 667 return ret; 669 668 }