diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-06-10 00:03:54 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-06-10 00:20:57 -0400 |
commit | bbc050488525e1ab1194c27355f63c66814385b8 (patch) | |
tree | e52941b8284958c1e147962ab901d19dca971f78 /drivers/target | |
parent | a95d6511303b848da45ee27b35018bb58087bdc6 (diff) |
iscsi-target: Fix ABORT_TASK + connection reset iscsi_queue_req memory leak
This patch fixes a iscsi_queue_req memory leak when ABORT_TASK response
has been queued by TFO->queue_tm_rsp() -> lio_queue_tm_rsp() after a
long standing I/O completes, but the connection has already reset and
waiting for cleanup to complete in iscsit_release_commands_from_conn()
-> transport_generic_free_cmd() -> transport_wait_for_tasks() code.
It moves iscsit_free_queue_reqs_for_conn() after the per-connection command
list has been released, so that the associated se_cmd tag can be completed +
released by target-core before freeing any remaining iscsi_queue_req memory
for the connection generated by lio_queue_tm_rsp().
Cc: Thomas Glanzmann <thomas@glanzmann.de>
Cc: Charalampos Pournaris <charpour@gmail.com>
Cc: stable@vger.kernel.org # 3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/iscsi/iscsi_target.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 2396216dd146..e0d98344e4bd 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
@@ -4231,8 +4231,6 @@ int iscsit_close_connection( | |||
4231 | if (conn->conn_transport->iscsit_wait_conn) | 4231 | if (conn->conn_transport->iscsit_wait_conn) |
4232 | conn->conn_transport->iscsit_wait_conn(conn); | 4232 | conn->conn_transport->iscsit_wait_conn(conn); |
4233 | 4233 | ||
4234 | iscsit_free_queue_reqs_for_conn(conn); | ||
4235 | |||
4236 | /* | 4234 | /* |
4237 | * During Connection recovery drop unacknowledged out of order | 4235 | * During Connection recovery drop unacknowledged out of order |
4238 | * commands for this connection, and prepare the other commands | 4236 | * commands for this connection, and prepare the other commands |
@@ -4249,6 +4247,7 @@ int iscsit_close_connection( | |||
4249 | iscsit_clear_ooo_cmdsns_for_conn(conn); | 4247 | iscsit_clear_ooo_cmdsns_for_conn(conn); |
4250 | iscsit_release_commands_from_conn(conn); | 4248 | iscsit_release_commands_from_conn(conn); |
4251 | } | 4249 | } |
4250 | iscsit_free_queue_reqs_for_conn(conn); | ||
4252 | 4251 | ||
4253 | /* | 4252 | /* |
4254 | * Handle decrementing session or connection usage count if | 4253 | * Handle decrementing session or connection usage count if |