fcst: Handle exchange timeout gracefully

This is a backport of commit e1c4038282c7586c3544542b37872c434669d3ac by
Mark Rustad <mark.d.rustad@intel.com>. This patch avoids that unregistering
a session hangs after an exchange timeout occurred.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4194 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2012-04-07 07:30:52 +00:00
parent 3c2957284c
commit 420f85c39b

View File

@@ -325,7 +325,9 @@ static void ft_recv_seq(struct fc_seq *sp, struct fc_frame *fp, void *arg)
* the session and all pending commands, so we ignore this response.
*/
if (IS_ERR(fp)) {
FT_IO_DBG("exchange error %ld - not handled\n", -PTR_ERR(fp));
FT_IO_DBG("exchange error %ld - aborting cmd\n", -PTR_ERR(fp));
scst_rx_mgmt_fn_tag(cmd->sess, SCST_ABORT_TASK, cmd->tag,
SCST_ATOMIC, NULL);
return;
}
@@ -486,6 +488,8 @@ void ft_cmd_tm_done(struct scst_mgmt_cmd *mcmd)
ft_cmd_tm_dump(mcmd, __func__);
fcmd = scst_mgmt_cmd_get_tgt_priv(mcmd);
if (!fcmd)
return;
switch (scst_mgmt_cmd_get_status(mcmd)) {
case SCST_MGMT_STATUS_SUCCESS:
code = FCP_TMF_CMPL;