Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af4de36d authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley
Browse files

[SCSI] zfcp: Block scsi_eh thread for rport state BLOCKED



In case the SCSI error recovery starts because of a SCSI command
timeout, but then something else triggers the rport to be deleted, the
SCSI error recovery will run to the end and set the SCSI device
offline. To prevent this, call the FC transport function
fc_block_scsi_eh which waits until the rport leaves the BLOCKED state.
This guarantees that communication is possible if the rport is ONLINE,
or the SCSI devices will be removed if the rport state switches to
NOT_PRESENT.

Reviewed-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@suse.de>
parent 4c571c65
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -209,6 +209,7 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
			break;
			break;


		zfcp_erp_wait(adapter);
		zfcp_erp_wait(adapter);
		fc_block_scsi_eh(scpnt);
		if (!(atomic_read(&adapter->status) &
		if (!(atomic_read(&adapter->status) &
		      ZFCP_STATUS_COMMON_RUNNING)) {
		      ZFCP_STATUS_COMMON_RUNNING)) {
			zfcp_dbf_scsi_abort("nres", adapter->dbf, scpnt, NULL,
			zfcp_dbf_scsi_abort("nres", adapter->dbf, scpnt, NULL,
@@ -248,6 +249,7 @@ static int zfcp_task_mgmt_function(struct scsi_cmnd *scpnt, u8 tm_flags)
			break;
			break;


		zfcp_erp_wait(adapter);
		zfcp_erp_wait(adapter);
		fc_block_scsi_eh(scpnt);
		if (!(atomic_read(&adapter->status) &
		if (!(atomic_read(&adapter->status) &
		      ZFCP_STATUS_COMMON_RUNNING)) {
		      ZFCP_STATUS_COMMON_RUNNING)) {
			zfcp_dbf_scsi_devreset("nres", tm_flags, unit, scpnt);
			zfcp_dbf_scsi_devreset("nres", tm_flags, unit, scpnt);
@@ -289,6 +291,7 @@ static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt)


	zfcp_erp_adapter_reopen(adapter, 0, "schrh_1", scpnt);
	zfcp_erp_adapter_reopen(adapter, 0, "schrh_1", scpnt);
	zfcp_erp_wait(adapter);
	zfcp_erp_wait(adapter);
	fc_block_scsi_eh(scpnt);


	return SUCCESS;
	return SUCCESS;
}
}