linux/drivers/target/iscsi
Nicholas Bellinger bb1f06f53b iscsi-target: Set session_fall_back_to_erl0 when forcing reinstatement
commit 197b806ae5 upstream.

While testing modification of per se_node_acl queue_depth forcing
session reinstatement via lio_target_nacl_cmdsn_depth_store() ->
core_tpg_set_initiator_node_queue_depth(), a hung task bug triggered
when changing cmdsn_depth invoked session reinstatement while an iscsi
login was already waiting for session reinstatement to complete.

This can happen when an outstanding se_cmd descriptor is taking a
long time to complete, and session reinstatement from iscsi login
or cmdsn_depth change occurs concurrently.

To address this bug, explicitly set session_fall_back_to_erl0 = 1
when forcing session reinstatement, so session reinstatement is
not attempted if an active session is already being shutdown.

This patch has been tested with two scenarios.  The first when
iscsi login is blocked waiting for iscsi session reinstatement
to complete followed by queue_depth change via configfs, and
second when queue_depth change via configfs us blocked followed
by a iscsi login driven session reinstatement.

Note this patch depends on commit d36ad77f70 to handle multiple
sessions per se_node_acl when changing cmdsn_depth, and for
pre v4.5 kernels will need to be included for stable as well.

Reported-by: Gary Guo <ghg@datera.io>
Tested-by: Gary Guo <ghg@datera.io>
Cc: Gary Guo <ghg@datera.io>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2017-05-20 14:28:34 +02:00
..
cxgbit chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's 2016-09-19 01:37:32 -04:00
iscsi_target.c iscsi-target: Set session_fall_back_to_erl0 when forcing reinstatement 2017-05-20 14:28:34 +02:00
iscsi_target.h target/iscsi: Replace __kernel_sockaddr_storage with sockaddr_storage 2015-08-26 23:27:25 -07:00
iscsi_target_auth.c treewide: Fix typos in printk 2016-04-28 10:52:28 +02:00
iscsi_target_auth.h iscsi-target: Fix CHAP_A parameter list handling 2014-06-05 19:44:02 -07:00
iscsi_target_configfs.c iscsi-target: Set session_fall_back_to_erl0 when forcing reinstatement 2017-05-20 14:28:34 +02:00
iscsi_target_datain_values.c iscsi-target: export symbols 2016-05-09 23:12:28 -07:00
iscsi_target_datain_values.h iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
iscsi_target_device.c target: Fix max_cmd_sn increment w/o cmdsn mutex regressions 2015-09-11 00:32:28 -07:00
iscsi_target_device.h target/iscsi: Remove unneeded wrapper functions 2012-02-25 14:37:47 -08:00
iscsi_target_erl0.c iscsi-target: remove usage of ->shutdown_session 2016-05-10 01:19:41 -07:00
iscsi_target_erl0.h iscsi-target: remove support for obsolete markers 2015-05-30 22:41:43 -07:00
iscsi_target_erl1.c iscsi-target: Fix indentation + spelling + unreachable code 2016-01-06 13:39:19 -08:00
iscsi_target_erl1.h iscsit: use the itt_t abstract type 2012-10-03 14:21:50 -07:00
iscsi_target_erl2.c iscsi-target: Move iscsi_target_[core,stat].h under linux include 2015-01-30 13:06:21 -08:00
iscsi_target_erl2.h iscsit: proper endianess conversions 2012-10-03 14:39:22 -07:00
iscsi_target_login.c iscsi-target: Set session_fall_back_to_erl0 when forcing reinstatement 2017-05-20 14:28:34 +02:00
iscsi_target_login.h Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-09-11 19:00:42 -07:00
iscsi_target_nego.c iscsi-target: Fix early sk_data_ready LOGIN_FLAGS_READY race 2016-05-17 00:27:05 -07:00
iscsi_target_nego.h iscsi-target: Initial traditional TCP conversion to iscsit_transport 2013-04-25 01:05:26 -07:00
iscsi_target_nodeattrib.c iscsi-target: Move iscsi_target_[core,stat].h under linux include 2015-01-30 13:06:21 -08:00
iscsi_target_nodeattrib.h iscsi-target: Expose default_erl as TPG attribute 2013-11-20 11:57:18 -08:00
iscsi_target_parameters.c iscsi-target: Drop work-around for legacy GlobalSAN initiator 2017-04-21 09:31:21 +02:00
iscsi_target_parameters.h iscsi-target: remove support for obsolete markers 2015-05-30 22:41:43 -07:00
iscsi_target_seq_pdu_list.c iscsi-target: Move iscsi_target_[core,stat].h under linux include 2015-01-30 13:06:21 -08:00
iscsi_target_seq_pdu_list.h target/iscsi: Fold _decide_list_to_build into _build_pdu_and_seq_lists 2012-04-14 17:40:38 -07:00
iscsi_target_stat.c target: use per-attribute show and store methods 2015-10-13 22:17:49 -07:00
iscsi_target_tmr.c iscsi-target: Fix indentation + spelling + unreachable code 2016-01-06 13:39:19 -08:00
iscsi_target_tmr.h iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
iscsi_target_tpg.c target/iscsi: Fix double free in lio_target_tiqn_addtpg() 2017-01-12 11:39:30 +01:00
iscsi_target_tpg.h target: Convert ACL change queue_depth se_session reference usage 2016-01-20 01:34:14 -08:00
iscsi_target_transport.c target: Deletion of unnecessary checks before the function call "module_put" 2014-12-01 21:35:21 -08:00
iscsi_target_util.c iscsi-target: Fix TMR reference leak during session shutdown 2017-04-21 09:31:20 +02:00
iscsi_target_util.h iscsi-target: remove support for obsolete markers 2015-05-30 22:41:43 -07:00
Kconfig cxgbit: add files for cxgbit.ko 2016-05-09 23:12:54 -07:00
Makefile cxgbit: add files for cxgbit.ko 2016-05-09 23:12:54 -07:00