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)
committerLuis Henriques <luis.henriques@canonical.com>
Mon, 30 Apr 2012 18:15:02 +0000 (19:15 +0100)
commit3b300af62d85512d019b870d9450b093ddf1dcaf
treec619263e6e0aad922a0fb2eba3a191171c43fb05
parent4bc27ddea6be4daae13b13f80368f662a7e645c7
tcm_fc: Add abort flag for gracefully handling exchange timeout

BugLink: http://bugs.launchpad.net/bugs/981162

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>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
drivers/target/tcm_fc/tcm_fc.h
drivers/target/tcm_fc/tfc_cmd.c
drivers/target/tcm_fc/tfc_io.c