mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 02:31:27 +00:00
fcst: Complain when refusing login
Log an error message when refusing login because a target port has not yet been enabled such that fcst users have a way to find out what happened. Also, make sure that ft_prli() returns a value in the range of the enumeration type fc_els_spp_resp. Note: since the return value of ft_prli() is only compared against FC_SPP_RESP_ACK in the current libfc implementation, this change doesn't affect the behavior of fcst. BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4027 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -367,9 +367,16 @@ static int ft_prli_locked(struct fc_rport_priv *rdata, u32 spp_len,
|
||||
if (!(fcp_parm & FCP_SPPF_INIT_FCN))
|
||||
return FC_SPP_RESP_CONF;
|
||||
tport = rcu_dereference(rdata->local_port->prov[FC_TYPE_FCP]);
|
||||
if (!tport || !tport->enabled)
|
||||
return 0; /* not a target for this local port */
|
||||
|
||||
if (!tport) {
|
||||
/* not a target for this local port */
|
||||
return FC_SPP_RESP_CONF;
|
||||
}
|
||||
if (!tport->enabled) {
|
||||
pr_err("Refused login from %#x because target port %s"
|
||||
" not yet enabled", rdata->ids.port_id,
|
||||
tport->tgt->tgt_name);
|
||||
return FC_SPP_RESP_CONF;
|
||||
}
|
||||
ret = ft_sess_create(tport, rdata, fcp_parm);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user