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

Commit 7dec9cf1 authored by Swen Schillig's avatar Swen Schillig Committed by James Bottomley
Browse files

[SCSI] zfcp: Report FC BSG errors in correct field



The status FC_CTELS_STATUS_REJECT for all FC BSG errors is not
appropriate. Instead, report -EIO in the result field if there was a
problem in zfcp with the FC BSG request. If the request is good from
our point of view, report result 0, status FC_CTELS_STATUS_OK and let
userspace read the Accept or Reject from the payload (as documented in
scsi_bsg_fc.h).

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@suse.de>
parent 9858ae38
Loading
Loading
Loading
Loading
+4 −5
Original line number Original line Diff line number Diff line
@@ -671,12 +671,11 @@ static void zfcp_fc_ct_els_job_handler(void *data)
{
{
	struct fc_bsg_job *job = data;
	struct fc_bsg_job *job = data;
	struct zfcp_fsf_ct_els *zfcp_ct_els = job->dd_data;
	struct zfcp_fsf_ct_els *zfcp_ct_els = job->dd_data;
	int status = zfcp_ct_els->status;
	struct fc_bsg_reply *jr = job->reply;
	int reply_status;


	reply_status = status ? FC_CTELS_STATUS_REJECT : FC_CTELS_STATUS_OK;
	jr->reply_payload_rcv_len = job->reply_payload.payload_len;
	job->reply->reply_data.ctels_reply.status = reply_status;
	jr->reply_data.ctels_reply.status = FC_CTELS_STATUS_OK;
	job->reply->reply_payload_rcv_len = job->reply_payload.payload_len;
	jr->result = zfcp_ct_els->status ? -EIO : 0;
	job->job_done(job);
	job->job_done(job);
}
}