Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358889
b: refs/heads/master
c: c7c4e7f
h: refs/heads/master
i:
  358887: 87355b4
v: v3
  • Loading branch information
Bart Van Assche authored and Roland Dreier committed Feb 25, 2013
1 parent 3e0fd79 commit 24e4167
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3780d1f08856f692116bcf026e4acf1c521df1c7
refs/heads/master: c7c4e7ff8047e43c45628b85ac200582e9404c39
29 changes: 15 additions & 14 deletions trunk/drivers/infiniband/ulp/srp/ib_srp.c
Original file line number Diff line number Diff line change
Expand Up @@ -700,23 +700,24 @@ static int srp_reconnect_target(struct srp_target_port *target)
struct Scsi_Host *shost = target->scsi_host;
int i, ret;

if (target->state != SRP_TARGET_LIVE)
return -EAGAIN;

scsi_target_block(&shost->shost_gendev);

srp_disconnect_target(target);
/*
* Now get a new local CM ID so that we avoid confusing the
* target in case things are really fouled up.
* Now get a new local CM ID so that we avoid confusing the target in
* case things are really fouled up. Doing so also ensures that all CM
* callbacks will have finished before a new QP is allocated.
*/
ret = srp_new_cm_id(target);
if (ret)
goto unblock;

ret = srp_create_target_ib(target);
if (ret)
goto unblock;
/*
* Whether or not creating a new CM ID succeeded, create a new
* QP. This guarantees that all completion callback function
* invocations have finished before request resetting starts.
*/
if (ret == 0)
ret = srp_create_target_ib(target);
else
srp_create_target_ib(target);

for (i = 0; i < SRP_CMD_SQ_SIZE; ++i) {
struct srp_request *req = &target->req_ring[i];
Expand All @@ -728,9 +729,9 @@ static int srp_reconnect_target(struct srp_target_port *target)
for (i = 0; i < SRP_SQ_SIZE; ++i)
list_add(&target->tx_ring[i]->list, &target->free_tx);

ret = srp_connect_target(target);
if (ret == 0)
ret = srp_connect_target(target);

unblock:
scsi_target_unblock(&shost->shost_gendev, ret == 0 ? SDEV_RUNNING :
SDEV_TRANSPORT_OFFLINE);

Expand Down Expand Up @@ -1739,7 +1740,7 @@ static int srp_abort(struct scsi_cmnd *scmnd)

shost_printk(KERN_ERR, target->scsi_host, "SRP abort called\n");

if (!req || target->qp_in_error || !srp_claim_req(target, req, scmnd))
if (!req || !srp_claim_req(target, req, scmnd))
return FAILED;
srp_send_tsk_mgmt(target, req->index, scmnd->device->lun,
SRP_TSK_ABORT_TASK);
Expand Down

0 comments on commit 24e4167

Please sign in to comment.