]> git.baikalelectronics.ru Git - kernel.git/commit
iscsi-target: Fix rx_login_comp hang after login failure
authorNicholas Bellinger <nab@linux-iscsi.org>
Thu, 5 Nov 2015 22:11:59 +0000 (14:11 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Sun, 29 Nov 2015 03:33:08 +0000 (19:33 -0800)
commitd2e00345c9633973a3b16ed9835d377e0404ab57
tree8df7de7ed5135398178fd25d1fd2cebe832100a2
parent64918e999b4607e3f7eea66065609116a69ce182
iscsi-target: Fix rx_login_comp hang after login failure

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 285eaee50820f1d7906762e0592ed58082fb127b
  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>
drivers/target/iscsi/iscsi_target.c
drivers/target/iscsi/iscsi_target_nego.c