]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
iscsi-target: Fix rx_login_comp hang after login failure
authorNicholas Bellinger <nab@linux-iscsi.org>
Sun, 6 Mar 2016 01:24:22 +0000 (01:24 +0000)
committerSasha Levin <sasha.levin@oracle.com>
Sun, 6 Mar 2016 03:11:40 +0000 (22:11 -0500)
commit4b4bc57ac1c2fd740f39e5849d45b9bcf6fbaf8b
tree4a29137df76f58fac564bb0810a2d1a708fa1ddc
parentb9a9cfdbf7254f4a231cc8ddf685cc29d3a9c6e5
iscsi-target: Fix rx_login_comp hang after login failure

[ Upstream commit ca82c2bded29b38d36140bfa1e76a7bbfcade390 ]

This patch addresses a case where iscsi_target_do_tx_login_io()
fails sending the last login response PDU, after the RX/TX
threads have already been started.

The case centers around iscsi_target_rx_thread() not invoking
allow_signal(SIGINT) before the send_sig(SIGINT, ...) occurs
from the failure path, resulting in RX thread hanging
indefinately on iscsi_conn->rx_login_comp.

Note this bug is a regression introduced by:

  commit e54198657b65625085834847ab6271087323ffea
  Author: Nicholas Bellinger <nab@linux-iscsi.org>
  Date:   Wed Jul 22 23:14:19 2015 -0700

      iscsi-target: Fix iscsit_start_kthreads failure OOPs

To address this bug, complete ->rx_login_complete for good
measure in the failure path, and immediately return from
RX thread context if connection state did not actually reach
full feature phase (TARG_CONN_STATE_LOGGED_IN).

Cc: Sagi Grimberg <sagig@mellanox.com>
Cc: <stable@vger.kernel.org> # v3.10+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/target/iscsi/iscsi_target.c
drivers/target/iscsi/iscsi_target_nego.c