Commit 086f44f5 authored by Bart Van Assche's avatar Bart Van Assche Committed by Roland Dreier

IB/srp: Avoid skipping srp_reset_host() after a transport error

The SCSI error handler assumes that the transport layer is operational
if an eh_abort_handler() returns SUCCESS.  Hence srp_abort() only
should return SUCCESS if sending the ABORT TASK task management
function succeeded.  This patch avoids the SCSI error handler skipping
the srp_reset_host() call after a transport layer error.
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Acked-by: default avatarDavid Dillow <dillowda@ornl.gov>
Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
parent 1fe0cb84
...@@ -1744,18 +1744,23 @@ static int srp_abort(struct scsi_cmnd *scmnd) ...@@ -1744,18 +1744,23 @@ static int srp_abort(struct scsi_cmnd *scmnd)
{ {
struct srp_target_port *target = host_to_target(scmnd->device->host); struct srp_target_port *target = host_to_target(scmnd->device->host);
struct srp_request *req = (struct srp_request *) scmnd->host_scribble; struct srp_request *req = (struct srp_request *) scmnd->host_scribble;
int ret;
shost_printk(KERN_ERR, target->scsi_host, "SRP abort called\n"); shost_printk(KERN_ERR, target->scsi_host, "SRP abort called\n");
if (!req || !srp_claim_req(target, req, scmnd)) if (!req || !srp_claim_req(target, req, scmnd))
return FAILED; return FAILED;
srp_send_tsk_mgmt(target, req->index, scmnd->device->lun, if (srp_send_tsk_mgmt(target, req->index, scmnd->device->lun,
SRP_TSK_ABORT_TASK); SRP_TSK_ABORT_TASK) == 0 ||
target->transport_offline)
ret = SUCCESS;
else
ret = FAILED;
srp_free_req(target, req, scmnd, 0); srp_free_req(target, req, scmnd, 0);
scmnd->result = DID_ABORT << 16; scmnd->result = DID_ABORT << 16;
scmnd->scsi_done(scmnd); scmnd->scsi_done(scmnd);
return SUCCESS; return ret;
} }
static int srp_reset_device(struct scsi_cmnd *scmnd) static int srp_reset_device(struct scsi_cmnd *scmnd)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment