]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
iscsi-target: Fix early sk_data_ready LOGIN_FLAGS_READY race
authorNicholas Bellinger <nab@linux-iscsi.org>
Sun, 28 Feb 2016 02:15:46 +0000 (18:15 -0800)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 22 Aug 2017 09:58:11 +0000 (06:58 -0300)
commit1f10a97e12fd9444237a91502ecf297a381c8b82
treefc8eced9447084d2665a5a023896c1f451c2ad8c
parent65f33aa2ab3dfdb9ed21032721050a2de6aaefb5
iscsi-target: Fix early sk_data_ready LOGIN_FLAGS_READY race

BugLink: http://bugs.launchpad.net/bugs/1711526
commit 8f0dfb3d8b1120c61f6e2cc3729290db10772b2d upstream.

There is a iscsi-target/tcp login race in LOGIN_FLAGS_READY
state assignment that can result in frequent errors during
iscsi discovery:

      "iSCSI Login negotiation failed."

To address this bug, move the initial LOGIN_FLAGS_READY
assignment ahead of iscsi_target_do_login() when handling
the initial iscsi_target_start_negotiation() request PDU
during connection login.

As iscsi_target_do_login_rx() work_struct callback is
clearing LOGIN_FLAGS_READ_ACTIVE after subsequent calls
to iscsi_target_do_login(), the early sk_data_ready
ahead of the first iscsi_target_do_login() expects
LOGIN_FLAGS_READY to also be set for the initial
login request PDU.

As reported by Maged, this was first obsered using an
MSFT initiator running across multiple VMWare host
virtual machines with iscsi-target/tcp.

Reported-by: Maged Mokhtar <mmokhtar@binarykinetics.com>
Tested-by: Maged Mokhtar <mmokhtar@binarykinetics.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/target/iscsi/iscsi_target_nego.c