Skip to content

Commit 4c571c6

Browse files
Christof SchmittJames Bottomley
authored andcommitted
[SCSI] zfcp: Update FSF error reporting
The SCSI midlayer retries commands based on the remote port state and the command status reported by the driver. Returning DID_TRANSPORT_DISRUPTED is a better approach, use this for reporting FSF errors back to the SCSI midlayer. See http://marc.info/?l=linux-scsi&m=125668044215051&w=2 as reference. There is also no need in special treatment of ABORTED commands, so remove the ZFCP_STATUS_FSFREQ_ABORTED, the commands are then returned with DID_TRANSPORT_DISRUPTED. Also remove the ZFCP_STATUS_FSFREQ_RETRY: It is useless, no retry is happening in the FSF layer and nobody checks the state of this flag. Reviewed-by: Swen Schillig <[email protected]> Signed-off-by: Christof Schmitt <[email protected]> Signed-off-by: James Bottomley <[email protected]>
1 parent ee74462 commit 4c571c6

File tree

2 files changed

+11
-29
lines changed

2 files changed

+11
-29
lines changed

drivers/s390/scsi/zfcp_def.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,8 @@
110110
#define ZFCP_STATUS_FSFREQ_CLEANUP 0x00000010
111111
#define ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED 0x00000040
112112
#define ZFCP_STATUS_FSFREQ_ABORTNOTNEEDED 0x00000080
113-
#define ZFCP_STATUS_FSFREQ_ABORTED 0x00000100
114113
#define ZFCP_STATUS_FSFREQ_TMFUNCFAILED 0x00000200
115114
#define ZFCP_STATUS_FSFREQ_TMFUNCNOTSUPP 0x00000400
116-
#define ZFCP_STATUS_FSFREQ_RETRY 0x00000800
117115
#define ZFCP_STATUS_FSFREQ_DISMISSED 0x00001000
118116

119117
/************************* STRUCTURE DEFINITIONS *****************************/

drivers/s390/scsi/zfcp_fsf.c

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,6 @@ static void zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *req)
315315
case FSF_SQ_ULP_DEPENDENT_ERP_REQUIRED:
316316
return;
317317
case FSF_SQ_COMMAND_ABORTED:
318-
req->status |= ZFCP_STATUS_FSFREQ_ABORTED;
319318
break;
320319
case FSF_SQ_NO_RECOM:
321320
dev_err(&req->adapter->ccw_device->dev,
@@ -356,8 +355,7 @@ static void zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *req)
356355
zfcp_dbf_hba_fsf_response(req);
357356

358357
if (req->status & ZFCP_STATUS_FSFREQ_DISMISSED) {
359-
req->status |= ZFCP_STATUS_FSFREQ_ERROR |
360-
ZFCP_STATUS_FSFREQ_RETRY; /* only for SCSI cmnds. */
358+
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
361359
return;
362360
}
363361

@@ -375,7 +373,7 @@ static void zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *req)
375373
case FSF_PROT_ERROR_STATE:
376374
case FSF_PROT_SEQ_NUMB_ERROR:
377375
zfcp_erp_adapter_reopen(adapter, 0, "fspse_2", req);
378-
req->status |= ZFCP_STATUS_FSFREQ_RETRY;
376+
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
379377
break;
380378
case FSF_PROT_UNSUPP_QTCB_TYPE:
381379
dev_err(&adapter->ccw_device->dev,
@@ -884,13 +882,11 @@ static void zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *req)
884882
break;
885883
case FSF_PORT_BOXED:
886884
zfcp_erp_port_boxed(unit->port, "fsafch3", req);
887-
req->status |= ZFCP_STATUS_FSFREQ_ERROR |
888-
ZFCP_STATUS_FSFREQ_RETRY;
885+
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
889886
break;
890887
case FSF_LUN_BOXED:
891888
zfcp_erp_unit_boxed(unit, "fsafch4", req);
892-
req->status |= ZFCP_STATUS_FSFREQ_ERROR |
893-
ZFCP_STATUS_FSFREQ_RETRY;
889+
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
894890
break;
895891
case FSF_ADAPTER_STATUS_AVAILABLE:
896892
switch (fsq->word[0]) {
@@ -988,8 +984,7 @@ static void zfcp_fsf_send_ct_handler(struct zfcp_fsf_req *req)
988984
case FSF_ACCESS_DENIED:
989985
break;
990986
case FSF_PORT_BOXED:
991-
req->status |= ZFCP_STATUS_FSFREQ_ERROR |
992-
ZFCP_STATUS_FSFREQ_RETRY;
987+
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
993988
break;
994989
case FSF_PORT_HANDLE_NOT_VALID:
995990
zfcp_erp_adapter_reopen(adapter, 0, "fsscth1", req);
@@ -1761,9 +1756,7 @@ static void zfcp_fsf_close_physical_port_handler(struct zfcp_fsf_req *req)
17611756
&unit->status);
17621757
read_unlock(&port->unit_list_lock);
17631758
zfcp_erp_port_boxed(port, "fscpph2", req);
1764-
req->status |= ZFCP_STATUS_FSFREQ_ERROR |
1765-
ZFCP_STATUS_FSFREQ_RETRY;
1766-
1759+
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
17671760
break;
17681761
case FSF_ADAPTER_STATUS_AVAILABLE:
17691762
switch (header->fsf_status_qual.word[0]) {
@@ -1867,8 +1860,7 @@ static void zfcp_fsf_open_unit_handler(struct zfcp_fsf_req *req)
18671860
break;
18681861
case FSF_PORT_BOXED:
18691862
zfcp_erp_port_boxed(unit->port, "fsouh_2", req);
1870-
req->status |= ZFCP_STATUS_FSFREQ_ERROR |
1871-
ZFCP_STATUS_FSFREQ_RETRY;
1863+
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
18721864
break;
18731865
case FSF_LUN_SHARING_VIOLATION:
18741866
if (header->fsf_status_qual.word[0])
@@ -2030,8 +2022,7 @@ static void zfcp_fsf_close_unit_handler(struct zfcp_fsf_req *req)
20302022
break;
20312023
case FSF_PORT_BOXED:
20322024
zfcp_erp_port_boxed(unit->port, "fscuh_3", req);
2033-
req->status |= ZFCP_STATUS_FSFREQ_ERROR |
2034-
ZFCP_STATUS_FSFREQ_RETRY;
2025+
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
20352026
break;
20362027
case FSF_ADAPTER_STATUS_AVAILABLE:
20372028
switch (req->qtcb->header.fsf_status_qual.word[0]) {
@@ -2164,13 +2155,8 @@ static void zfcp_fsf_send_fcp_command_task_handler(struct zfcp_fsf_req *req)
21642155
return;
21652156
}
21662157

2167-
if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ABORTED)) {
2168-
set_host_byte(scpnt, DID_SOFT_ERROR);
2169-
goto skip_fsfstatus;
2170-
}
2171-
21722158
if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) {
2173-
set_host_byte(scpnt, DID_ERROR);
2159+
set_host_byte(scpnt, DID_TRANSPORT_DISRUPTED);
21742160
goto skip_fsfstatus;
21752161
}
21762162

@@ -2266,13 +2252,11 @@ static void zfcp_fsf_send_fcp_command_handler(struct zfcp_fsf_req *req)
22662252
break;
22672253
case FSF_PORT_BOXED:
22682254
zfcp_erp_port_boxed(unit->port, "fssfch5", req);
2269-
req->status |= ZFCP_STATUS_FSFREQ_ERROR |
2270-
ZFCP_STATUS_FSFREQ_RETRY;
2255+
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
22712256
break;
22722257
case FSF_LUN_BOXED:
22732258
zfcp_erp_unit_boxed(unit, "fssfch6", req);
2274-
req->status |= ZFCP_STATUS_FSFREQ_ERROR |
2275-
ZFCP_STATUS_FSFREQ_RETRY;
2259+
req->status |= ZFCP_STATUS_FSFREQ_ERROR;
22762260
break;
22772261
case FSF_ADAPTER_STATUS_AVAILABLE:
22782262
if (header->fsf_status_qual.word[0] ==

0 commit comments

Comments
 (0)