diff --git a/include/spdk/iscsi_spec.h b/include/spdk/iscsi_spec.h index c81a81241..06e567865 100644 --- a/include/spdk/iscsi_spec.h +++ b/include/spdk/iscsi_spec.h @@ -203,7 +203,8 @@ struct iscsi_bhs_logout_req { uint8_t opcode : 6; /* opcode = 0x06 */ uint8_t immediate : 1; uint8_t reserved : 1; - uint8_t reason; + uint8_t reason : 7; + uint8_t reason_1 : 1; uint8_t res[2]; uint8_t total_ahs_len; uint8_t data_segment_len[3]; @@ -482,9 +483,6 @@ struct iscsi_bhs_text_resp { /* text flags */ #define ISCSI_TEXT_CONTINUE 0x40 -/* logout flags */ -#define ISCSI_LOGOUT_REASON_MASK 0x7f - /* datain flags */ #define ISCSI_DATAIN_ACKNOLWEDGE 0x40 #define ISCSI_DATAIN_OVERFLOW 0x04 diff --git a/lib/iscsi/iscsi.c b/lib/iscsi/iscsi.c index 77a493dee..0b2c56f00 100644 --- a/lib/iscsi/iscsi.c +++ b/lib/iscsi/iscsi.c @@ -2439,15 +2439,9 @@ spdk_iscsi_op_logout(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) struct iscsi_bhs_logout_req *reqh; struct iscsi_bhs_logout_resp *rsph; uint16_t cid; -#ifdef DEBUG - int reason; -#endif reqh = (struct iscsi_bhs_logout_req *)&pdu->bhs; -#ifdef DEBUG - reason = reqh->reason & ISCSI_LOGOUT_REASON_MASK; -#endif cid = from_be16(&reqh->cid); task_tag = from_be32(&reqh->itt); CmdSN = from_be32(&reqh->cmd_sn); @@ -2455,7 +2449,7 @@ spdk_iscsi_op_logout(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu) ExpStatSN = from_be32(&reqh->exp_stat_sn); SPDK_DEBUGLOG(SPDK_TRACE_ISCSI, "reason=%d, ITT=%x, cid=%d\n", - reason, task_tag, cid); + reqh->reason, task_tag, cid); if (reqh->reason != 0 && conn->sess->session_type == SESSION_TYPE_DISCOVERY) { SPDK_ERRLOG("only logout with close the session reason can be in discovery session");