scsi: qla2xxx: don't break the bsg-lib abstractions
Always use bsg_job->reply instead of scsi_req(bsg_job->req)->sense), as they always point to the same memory. Never set scsi_req(bsg_job->req)->result and we'll set that value through bsg_job_done. [mkp: applied by hand, fixed whitespace] Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Himanshu Madhani <himanshu.madhani@cavium.com> Tested-by: Himanshu Madhani <himanshu.madhani@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
07f5d563c6
commit
05231a3bb7
@@ -1544,7 +1544,6 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
struct fc_bsg_reply *bsg_reply;
|
||||
uint16_t comp_status;
|
||||
uint32_t fw_status[3];
|
||||
uint8_t* fw_sts_ptr;
|
||||
int res;
|
||||
struct srb_iocb *els;
|
||||
|
||||
@@ -1637,11 +1636,7 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
type, sp->handle, comp_status, fw_status[1], fw_status[2],
|
||||
le16_to_cpu(((struct els_sts_entry_24xx *)
|
||||
pkt)->total_byte_count));
|
||||
fw_sts_ptr = ((uint8_t*)scsi_req(bsg_job->req)->sense) +
|
||||
sizeof(struct fc_bsg_reply);
|
||||
memcpy( fw_sts_ptr, fw_status, sizeof(fw_status));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
ql_dbg(ql_dbg_user, vha, 0x5040,
|
||||
"ELS-CT pass-through-%s error hdl=%x comp_status-status=0x%x "
|
||||
"error subcode 1=0x%x error subcode 2=0x%x.\n",
|
||||
@@ -1652,10 +1647,9 @@ qla24xx_els_ct_entry(scsi_qla_host_t *vha, struct req_que *req,
|
||||
pkt)->error_subcode_2));
|
||||
res = DID_ERROR << 16;
|
||||
bsg_reply->reply_payload_rcv_len = 0;
|
||||
fw_sts_ptr = ((uint8_t*)scsi_req(bsg_job->req)->sense) +
|
||||
sizeof(struct fc_bsg_reply);
|
||||
memcpy( fw_sts_ptr, fw_status, sizeof(fw_status));
|
||||
}
|
||||
memcpy(bsg_job->reply + sizeof(struct fc_bsg_reply),
|
||||
fw_status, sizeof(fw_status));
|
||||
ql_dump_buffer(ql_dbg_user + ql_dbg_buffer, vha, 0x5056,
|
||||
(uint8_t *)pkt, sizeof(*pkt));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user