target: Re-add missing SCF_ACK_KREF assignment in v4.1.y
authorNicholas Bellinger <nab@linux-iscsi.org>
Tue, 4 Oct 2016 23:37:05 +0000 (16:37 -0700)
committerSasha Levin <alexander.levin@verizon.com>
Thu, 24 Nov 2016 00:58:29 +0000 (19:58 -0500)
commitac49951623e11d78c4772d88ec54584bd4840e4c
tree6d659b0ed29de3ce6b1e8e92228dd6b98c5f49de
parenteaf55207fe3b47951939d70a90c741ee8e789281
target: Re-add missing SCF_ACK_KREF assignment in v4.1.y

[ Upstream commit 527268df31e57cf2b6d417198717c6d6afdb1e3e ]

This patch fixes a regression in >= v4.1.y code where the original
SCF_ACK_KREF assignment in target_get_sess_cmd() was dropped upstream
in commit 054922bb, but the series for addressing TMR ABORT_TASK +
LUN_RESET with fabric session reinstatement in commit febe562c20 still
depends on this code in transport_cmd_finish_abort().

The regression manifests itself as a se_cmd->cmd_kref +1 leak, where
ABORT_TASK + LUN_RESET can hang indefinately for a specific I_T session
for drivers using SCF_ACK_KREF, resulting in hung kthreads.

This patch has been verified with v4.1.y code.

Reported-by: Vaibhav Tandon <vst@datera.io>
Tested-by: Vaibhav Tandon <vst@datera.io>
Cc: Vaibhav Tandon <vst@datera.io>
Cc: stable@vger.kernel.org # 4.1+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/target/target_core_transport.c