* Patch "iscsi-target: Fix iser explicit logout TX kthread leak" has been added to the 4.1-stable tree
@ 2015-08-08 22:02 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-08-08 22:02 UTC (permalink / raw)
To: nab, gregkh, sagig; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
iscsi-target: Fix iser explicit logout TX kthread leak
to the 4.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
iscsi-target-fix-iser-explicit-logout-tx-kthread-leak.patch
and it can be found in the queue-4.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.
>From 007d038bdf95ccfe2491d0078be54040d110fd06 Mon Sep 17 00:00:00 2001
From: Nicholas Bellinger <nab@linux-iscsi.org>
Date: Thu, 23 Jul 2015 22:30:31 +0000
Subject: iscsi-target: Fix iser explicit logout TX kthread leak
From: Nicholas Bellinger <nab@linux-iscsi.org>
commit 007d038bdf95ccfe2491d0078be54040d110fd06 upstream.
This patch fixes a regression introduced with the following commit
in v4.0-rc1 code, where an explicit iser-target logout would result
in ->tx_thread_active being incorrectly cleared by the logout post
handler, and subsequent TX kthread leak:
commit 88dcd2dab5c23b1c9cfc396246d8f476c872f0ca
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date: Thu Feb 26 22:19:15 2015 -0800
iscsi-target: Convert iscsi_thread_set usage to kthread.h
To address this bug, change iscsit_logout_post_handler_closesession()
and iscsit_logout_post_handler_samecid() to only cmpxchg() on
->tx_thread_active for traditional iscsi/tcp connections.
This is required because iscsi/tcp connections are invoking logout
post handler logic directly from TX kthread context, while iser
connections are invoking logout post handler logic from a seperate
workqueue context.
Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/target/iscsi/iscsi_target.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -4555,7 +4555,18 @@ static void iscsit_logout_post_handler_c
struct iscsi_conn *conn)
{
struct iscsi_session *sess = conn->sess;
- int sleep = cmpxchg(&conn->tx_thread_active, true, false);
+ int sleep = 1;
+ /*
+ * Traditional iscsi/tcp will invoke this logic from TX thread
+ * context during session logout, so clear tx_thread_active and
+ * sleep if iscsit_close_connection() has not already occured.
+ *
+ * Since iser-target invokes this logic from it's own workqueue,
+ * always sleep waiting for RX/TX thread shutdown to complete
+ * within iscsit_close_connection().
+ */
+ if (conn->conn_transport->transport_type == ISCSI_TCP)
+ sleep = cmpxchg(&conn->tx_thread_active, true, false);
atomic_set(&conn->conn_logout_remove, 0);
complete(&conn->conn_logout_comp);
@@ -4569,7 +4580,10 @@ static void iscsit_logout_post_handler_c
static void iscsit_logout_post_handler_samecid(
struct iscsi_conn *conn)
{
- int sleep = cmpxchg(&conn->tx_thread_active, true, false);
+ int sleep = 1;
+
+ if (conn->conn_transport->transport_type == ISCSI_TCP)
+ sleep = cmpxchg(&conn->tx_thread_active, true, false);
atomic_set(&conn->conn_logout_remove, 0);
complete(&conn->conn_logout_comp);
Patches currently in stable-queue which might be from nab@linux-iscsi.org are
queue-4.1/iscsi-target-fix-iscsit_start_kthreads-failure-oops.patch
queue-4.1/qla2xxx-release-request-queue-reservation.patch
queue-4.1/qla2xxx-fix-command-initialization-in-target-mode.patch
queue-4.1/iscsi-target-fix-iser-explicit-logout-tx-kthread-leak.patch
queue-4.1/iscsi-target-fix-use-after-free-during-tpg-session-shutdown.patch
queue-4.1/qla2xxx-fix-hardware-lock-unlock-issue-causing-kernel-panic.patch
queue-4.1/qla2xxx-remove-msleep-in-qlt_send_term_exchange.patch
queue-4.1/qla2xxx-kill-sessions-log-out-initiator-on-rscn-and-port-down-events.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-08 22:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-08 22:02 Patch "iscsi-target: Fix iser explicit logout TX kthread leak" has been added to the 4.1-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).