Skip to content

Commit

Permalink
[SCSI] zfcp: fix deadlock between wq triggered port scan and ERP
Browse files Browse the repository at this point in the history
Waiting for the ERP to be finished in a task running in the global
kernel work-queue is a bad idea, especially if the ERP needs to run
another job in this work-queue before it can finish. -> deadlock.

This patch removes the necessity to wait for a finished ERP from the
scan task and moves the job scheduling to the end of the ERP.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
sswen authored and James Bottomley committed Dec 1, 2008
1 parent 0ac55aa commit fca55b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/s390/scsi/zfcp_erp.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,6 @@ static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *act,
goto failed_openfcp;

atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &act->adapter->status);
schedule_work(&act->adapter->scan_work);

return ZFCP_ERP_SUCCEEDED;

Expand Down Expand Up @@ -1284,6 +1283,8 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
if (result != ZFCP_ERP_SUCCEEDED)
zfcp_erp_rports_del(adapter);
else
schedule_work(&adapter->scan_work);
zfcp_adapter_put(adapter);
break;
}
Expand Down
1 change: 0 additions & 1 deletion drivers/s390/scsi/zfcp_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter)
int ret, i;
struct zfcp_gpn_ft *gpn_ft;

zfcp_erp_wait(adapter); /* wait until adapter is finished with ERP */
if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT)
return 0;

Expand Down

0 comments on commit fca55b6

Please sign in to comment.