summaryrefslogtreecommitdiffstats
path: root/drivers/target/tcm_fc/tfc_io.c
diff options
context:
space:
mode:
authorMark Rustad <mark.d.rustad@intel.com>2012-04-03 19:24:41 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2012-04-07 03:56:43 +0200
commite1c4038282c7586c3544542b37872c434669d3ac (patch)
treef747aea02b1e52b14ba89bd7606cd4d8bdccc279 /drivers/target/tcm_fc/tfc_io.c
parentLinux 3.4-rc1 (diff)
downloadlinux-e1c4038282c7586c3544542b37872c434669d3ac.tar.xz
linux-e1c4038282c7586c3544542b37872c434669d3ac.zip
tcm_fc: Add abort flag for gracefully handling exchange timeout
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> Cc: <stable@vger.kernel.org> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to '')
-rw-r--r--drivers/target/tcm_fc/tfc_io.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c
index 2b693eefac55..dc7c0db26e20 100644
--- a/drivers/target/tcm_fc/tfc_io.c
+++ b/drivers/target/tcm_fc/tfc_io.c
@@ -81,6 +81,8 @@ int ft_queue_data_in(struct se_cmd *se_cmd)
void *from;
void *to = NULL;
+ if (cmd->aborted)
+ return 0;
ep = fc_seq_exch(cmd->seq);
lport = ep->lp;
cmd->seq = lport->tt.seq_start_next(cmd->seq);