iser-target: remove command with state ISTATE_REMOVE
authorJenny Derzhavetz <jennyf@mellanox.com>
Sun, 6 Sep 2015 11:52:20 +0000 (14:52 +0300)
committerSasha Levin <sasha.levin@oracle.com>
Wed, 28 Oct 2015 02:12:54 +0000 (22:12 -0400)
commit645c23ecfd8ef0f81a42db43ad60d8c28ca3348c
tree8a8a16ef890ff44ce64e46925d700a7e5ea47443
parentbda8d5c1a05079c10da9fd43b04ad00cd853fb79
iser-target: remove command with state ISTATE_REMOVE

[ Upstream commit a4c15cd957cbd728f685645de7a150df5912591a ]

As documented in iscsit_sequence_cmd:
/*
 * Existing callers for iscsit_sequence_cmd() will silently
 * ignore commands with CMDSN_LOWER_THAN_EXP, so force this
 * return for CMDSN_MAXCMDSN_OVERRUN as well..
 */

We need to silently finish a command when it's in ISTATE_REMOVE.
This fixes an teardown hang we were seeing where a mis-behaved
initiator (triggered by allocation error injections) sent us a
cmdsn which was lower than expected.

Signed-off-by: Jenny Derzhavetz <jennyf@mellanox.com>
Signed-off-by: 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/infiniband/ulp/isert/ib_isert.c