Skip to content

Commit fca55b6

Browse files
sswenjejb
authored andcommitted
[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: Swen Schillig <[email protected]> Signed-off-by: Christof Schmitt <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent 0ac55aa commit fca55b6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/s390/scsi/zfcp_erp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,6 @@ static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *act,
720720
goto failed_openfcp;
721721

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

725724
return ZFCP_ERP_SUCCEEDED;
726725

@@ -1284,6 +1283,8 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
12841283
case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
12851284
if (result != ZFCP_ERP_SUCCEEDED)
12861285
zfcp_erp_rports_del(adapter);
1286+
else
1287+
schedule_work(&adapter->scan_work);
12871288
zfcp_adapter_put(adapter);
12881289
break;
12891290
}

drivers/s390/scsi/zfcp_fc.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,6 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter)
610610
int ret, i;
611611
struct zfcp_gpn_ft *gpn_ft;
612612

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

0 commit comments

Comments
 (0)