From 594d07c42db1625d70daa9b0ac7e8a20d29b1513 Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Thu, 21 Aug 2008 23:03:25 -0500 Subject: [PATCH 9/9] libfc: Do not return DID_ABORT unless we have to I added this bug when I fixed the abort code. If fc_fcp.c is forcing a retry then we do not want to complete the command with DID_ABORT because that will fail the command. If we are aborting the command from the scsi eh it does not really matter because the scsi_done code is short circuited. Signed-off-by: Mike Christie --- drivers/scsi/libfc/fc_fcp.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index f2915ed..e974ce1 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c @@ -612,7 +612,6 @@ static void fc_fcp_abts_resp(struct fc_fcp_pkt *fsp, struct fc_frame_header *fh) if (fh->fh_r_ctl == FC_RCTL_BA_ACC) { fsp->state |= FC_SRB_ABORTED; fsp->state &= ~FC_SRB_ABORT_PENDING; - fsp->status_code = FC_CMD_ABORTED; if (fsp->wait_for_comp) complete(&fsp->tm_done); @@ -859,9 +858,10 @@ static void fc_fcp_complete(struct fc_fcp_pkt *fsp) if (fsp->state & FC_SRB_ABORT_PENDING) return; - if (fsp->state & FC_SRB_ABORTED) - fsp->status_code = FC_CMD_ABORTED; - else { + if (fsp->state & FC_SRB_ABORTED) { + if (!fsp->status_code) + fsp->status_code = FC_CMD_ABORTED; + } else { /* * Test for transport underrun, independent of response * underrun status. -- 1.5.5.1