tcm_fc: Add abort flag for gracefully handling exchange timeout
authorMark Rustad <mark.d.rustad@intel.com>
Tue, 3 Apr 2012 17:24:41 +0000 (10:24 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2012 15:33:49 +0000 (08:33 -0700)
commit3e9e7cc0e5cf8d8234bce7b85692f2c6082e1e85
tree7175081390edcab8eacf6ab95e38ca871c7ab64f
parentbd4a0cb6f12b87c701f25519acb89308321023d9
tcm_fc: Add abort flag for gracefully handling exchange timeout

commit e1c4038282c7586c3544542b37872c434669d3ac upstream.

Add abort flag and use it to terminate processing when an exchange
is timed out or is reset. The abort flag is used in place of the
transport_generic_free_cmd function call in the reset and timeout
cases, because calling that function in that context would free
memory that was in use. The aborted flag allows the lifetime to
be managed in a more normal way, while truncating the processing.

This change eliminates a source of memory corruption which
manifested in a variety of ugly ways.

(nab: Drop unused struct fc_exch *ep in ft_recv_seq)

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Acked-by: Kiran Patil <Kiran.patil@intel.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/target/tcm_fc/tcm_fc.h
drivers/target/tcm_fc/tfc_cmd.c
drivers/target/tcm_fc/tfc_io.c