+1
−1
Loading
The following steps are expected on iSCSI login:
Initiator Target
login req ->
set CONN STATE INVALID
<- login resp
...
PDU write cb
set CONN STATE RUNNING
CHAP req ->
Test CONN STATE(expected RUNNING)
Because of socket pending list for asynchronous requests mechanism[1],
unexpected INVALID state maybe hit on CHAP request:
Initiator Target
login req ->
set CONN STATE INVALID
<- login resp
CHAP req ->
Test CONN STATE(unexpected INVALID)
...
PDU write cb (delayed)
set CONN STATE RUNNING
This leads iscsi_op_login_phase_none() re-entry, a CHAP request
gets error with log "InitiatorName is empty".
In fact, once the target handles LOGIN request and prepare to send
response, it has already becomes RUNNING state. Set RUNNING state
immediately instead of callback funcion, any unlikely error occurs
before callback, EXITING will overwrite the state.
[1]: SPDK commit: ab22d249
Change-Id: Ic41575cf600478496046888b6d5806e6beb09aea
Signed-off-by:
zhenwei pi <pizhenwei@bytedance.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/19944
Reviewed-by:
Changpeng Liu <changpeng.liu@intel.com>
Community-CI: Mellanox Build Bot
Tested-by:
SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by:
Shuhei Matsumoto <smatsumoto@nvidia.com>