aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c8
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index bd96cecaa619..a13db5908426 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -433,6 +433,9 @@ static void ibmvfc_set_tgt_action(struct ibmvfc_target *tgt,
433{ 433{
434 switch (tgt->action) { 434 switch (tgt->action) {
435 case IBMVFC_TGT_ACTION_DEL_RPORT: 435 case IBMVFC_TGT_ACTION_DEL_RPORT:
436 if (action == IBMVFC_TGT_ACTION_DELETED_RPORT)
437 tgt->action = action;
438 case IBMVFC_TGT_ACTION_DELETED_RPORT:
436 break; 439 break;
437 default: 440 default:
438 if (action == IBMVFC_TGT_ACTION_DEL_RPORT) 441 if (action == IBMVFC_TGT_ACTION_DEL_RPORT)
@@ -4193,11 +4196,15 @@ static void ibmvfc_tgt_add_rport(struct ibmvfc_target *tgt)
4193 if (rport && tgt->action == IBMVFC_TGT_ACTION_DEL_RPORT) { 4196 if (rport && tgt->action == IBMVFC_TGT_ACTION_DEL_RPORT) {
4194 tgt_dbg(tgt, "Deleting rport\n"); 4197 tgt_dbg(tgt, "Deleting rport\n");
4195 list_del(&tgt->queue); 4198 list_del(&tgt->queue);
4199 ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DELETED_RPORT);
4196 spin_unlock_irqrestore(vhost->host->host_lock, flags); 4200 spin_unlock_irqrestore(vhost->host->host_lock, flags);
4197 fc_remote_port_delete(rport); 4201 fc_remote_port_delete(rport);
4198 del_timer_sync(&tgt->timer); 4202 del_timer_sync(&tgt->timer);
4199 kref_put(&tgt->kref, ibmvfc_release_tgt); 4203 kref_put(&tgt->kref, ibmvfc_release_tgt);
4200 return; 4204 return;
4205 } else if (rport && tgt->action == IBMVFC_TGT_ACTION_DELETED_RPORT) {
4206 spin_unlock_irqrestore(vhost->host->host_lock, flags);
4207 return;
4201 } 4208 }
4202 4209
4203 if (rport) { 4210 if (rport) {
@@ -4297,6 +4304,7 @@ static void ibmvfc_do_work(struct ibmvfc_host *vhost)
4297 rport = tgt->rport; 4304 rport = tgt->rport;
4298 tgt->rport = NULL; 4305 tgt->rport = NULL;
4299 list_del(&tgt->queue); 4306 list_del(&tgt->queue);
4307 ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DELETED_RPORT);
4300 spin_unlock_irqrestore(vhost->host->host_lock, flags); 4308 spin_unlock_irqrestore(vhost->host->host_lock, flags);
4301 if (rport) 4309 if (rport)
4302 fc_remote_port_delete(rport); 4310 fc_remote_port_delete(rport);
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h
index d7e8dcd90650..af48172112fa 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.h
+++ b/drivers/scsi/ibmvscsi/ibmvfc.h
@@ -597,6 +597,7 @@ enum ibmvfc_target_action {
597 IBMVFC_TGT_ACTION_INIT, 597 IBMVFC_TGT_ACTION_INIT,
598 IBMVFC_TGT_ACTION_INIT_WAIT, 598 IBMVFC_TGT_ACTION_INIT_WAIT,
599 IBMVFC_TGT_ACTION_DEL_RPORT, 599 IBMVFC_TGT_ACTION_DEL_RPORT,
600 IBMVFC_TGT_ACTION_DELETED_RPORT,
600}; 601};
601 602
602struct ibmvfc_target { 603struct ibmvfc_target {