iscsi: update the error message for the login init

Change-Id: Ic6baf284753c625d9f1d3110149f67ce4b48c0e7
Signed-off-by: GangCao <gang.cao@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/458406
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
GangCao 2019-06-18 17:28:11 -04:00 committed by Darek Stojaczyk
parent 6a75bb948e
commit c3d1e498d5

View File

@ -1873,7 +1873,9 @@ iscsi_op_login_rsp_init(struct spdk_iscsi_conn *conn,
rsp_pdu->data = calloc(1, *alloc_len); rsp_pdu->data = calloc(1, *alloc_len);
if (!rsp_pdu->data) { if (!rsp_pdu->data) {
SPDK_ERRLOG("calloc() failed for data segment\n"); SPDK_ERRLOG("calloc() failed for data segment\n");
return -ENOMEM; rsph->status_class = ISCSI_CLASS_TARGET_ERROR;
rsph->status_detail = ISCSI_LOGIN_STATUS_NO_RESOURCES;
return SPDK_ISCSI_LOGIN_ERROR_RESPONSE;
} }
reqh = (struct iscsi_bhs_login_req *)&pdu->bhs; reqh = (struct iscsi_bhs_login_req *)&pdu->bhs;
@ -1922,6 +1924,8 @@ iscsi_op_login_rsp_init(struct spdk_iscsi_conn *conn,
if (ISCSI_BHS_LOGIN_GET_TBIT(rsph->flags) && if (ISCSI_BHS_LOGIN_GET_TBIT(rsph->flags) &&
ISCSI_BHS_LOGIN_GET_CBIT(rsph->flags)) { ISCSI_BHS_LOGIN_GET_CBIT(rsph->flags)) {
SPDK_ERRLOG("transit error\n"); SPDK_ERRLOG("transit error\n");
rsph->status_class = ISCSI_CLASS_INITIATOR_ERROR;
rsph->status_detail = ISCSI_LOGIN_INITIATOR_ERROR;
return SPDK_ISCSI_LOGIN_ERROR_RESPONSE; return SPDK_ISCSI_LOGIN_ERROR_RESPONSE;
} }
/* make sure reqh->version_max < ISCSI_VERSION */ /* make sure reqh->version_max < ISCSI_VERSION */