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

Commit 65a8d4e1 authored by Andreas Herrmann's avatar Andreas Herrmann Committed by James Bottomley
Browse files

[SCSI] zfcp: fix: reopen port only if link-test fails



From: Maxim Shchetynin <maxim@de.ibm.com>

Reopen a remote port only if the link-test fails. This avoids that a
port is unnecessarily reopened.

Signed-off-by: default avatarAndreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 22753fa5
Loading
Loading
Loading
Loading
+4 −15
Original line number Original line Diff line number Diff line
@@ -1267,8 +1267,7 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req)
		case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
		case FSF_SQ_INVOKE_LINK_TEST_PROCEDURE:
			debug_text_event(new_fsf_req->adapter->erp_dbf, 1,
			debug_text_event(new_fsf_req->adapter->erp_dbf, 1,
					 "fsf_sq_ltest");
					 "fsf_sq_ltest");
			/* reopening link to port */
			zfcp_test_link(unit->port);
			zfcp_erp_port_reopen(unit->port, 0);
			new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
			new_fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
			break;
			break;
		case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
		case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
@@ -3125,7 +3124,7 @@ zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *fsf_req)
			/* Re-establish link to port */
			/* Re-establish link to port */
			debug_text_event(adapter->erp_dbf, 1,
			debug_text_event(adapter->erp_dbf, 1,
					 "fsf_sq_ltest");
					 "fsf_sq_ltest");
			zfcp_erp_port_reopen(unit->port, 0);
			zfcp_test_link(unit->port);
			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
			break;
			break;
		case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
		case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
@@ -3368,7 +3367,7 @@ zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *fsf_req)
			/* re-establish link to port */
			/* re-establish link to port */
			debug_text_event(fsf_req->adapter->erp_dbf, 1,
			debug_text_event(fsf_req->adapter->erp_dbf, 1,
					 "fsf_sq_ltest");
					 "fsf_sq_ltest");
			zfcp_erp_port_reopen(unit->port, 0);
			zfcp_test_link(unit->port);
			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
			break;
			break;
		case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
		case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
@@ -3931,12 +3930,7 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
			/* re-establish link to port */
			/* re-establish link to port */
			debug_text_event(fsf_req->adapter->erp_dbf, 1,
			debug_text_event(fsf_req->adapter->erp_dbf, 1,
					 "fsf_sq_ltest");
					 "fsf_sq_ltest");
			zfcp_erp_port_reopen(unit->port, 0);
 			zfcp_test_link(unit->port);
			zfcp_cmd_dbf_event_fsf(
				"sqltest",
				fsf_req,
				&header->fsf_status_qual,
				sizeof (union fsf_status_qual));
			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
			break;
			break;
		case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
		case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
@@ -3944,11 +3938,6 @@ zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *fsf_req)
			/* let scsi stack deal with retries and escalation */
			/* let scsi stack deal with retries and escalation */
			debug_text_event(fsf_req->adapter->erp_dbf, 1,
			debug_text_event(fsf_req->adapter->erp_dbf, 1,
					 "fsf_sq_ulp");
					 "fsf_sq_ulp");
			zfcp_cmd_dbf_event_fsf(
				"sqdeperp",
				fsf_req,
				&header->fsf_status_qual,
				sizeof (union fsf_status_qual));
			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
			fsf_req->status |= ZFCP_STATUS_FSFREQ_ERROR;
			break;
			break;
		default:
		default: