Commit fca55b6f authored by Swen Schillig's avatar Swen Schillig Committed by James Bottomley

[SCSI] zfcp: fix deadlock between wq triggered port scan and ERP

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: default avatarSwen Schillig <swen@vnet.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 0ac55aa9
...@@ -720,7 +720,6 @@ static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *act, ...@@ -720,7 +720,6 @@ static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *act,
goto failed_openfcp; goto failed_openfcp;
atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &act->adapter->status); atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &act->adapter->status);
schedule_work(&act->adapter->scan_work);
return ZFCP_ERP_SUCCEEDED; return ZFCP_ERP_SUCCEEDED;
...@@ -1284,6 +1283,8 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result) ...@@ -1284,6 +1283,8 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
case ZFCP_ERP_ACTION_REOPEN_ADAPTER: case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
if (result != ZFCP_ERP_SUCCEEDED) if (result != ZFCP_ERP_SUCCEEDED)
zfcp_erp_rports_del(adapter); zfcp_erp_rports_del(adapter);
else
schedule_work(&adapter->scan_work);
zfcp_adapter_put(adapter); zfcp_adapter_put(adapter);
break; break;
} }
......
...@@ -610,7 +610,6 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter) ...@@ -610,7 +610,6 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter)
int ret, i; int ret, i;
struct zfcp_gpn_ft *gpn_ft; 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) if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT)
return 0; return 0;
......
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