scsi: iscsi: Fix iSCSI cls conn state
authorMike Christie <michael.christie@oracle.com>
Tue, 13 Jul 2021 09:18:37 +0000 (17:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:56 +0000 (09:44 +0200)
commit4ad382bc4abca717fe2e3203a2bdc9770b34e8aa
tree44ea2ce0cbb15f5baf712b067b1ff2d465d1aef1
parent221b7e1e76fb02a02a31001b253011a2725eb1ac
scsi: iscsi: Fix iSCSI cls conn state

commit 0dcf8febcb7b9d42bec98bc068e01d1a6ea578b8 upstream.

In commit 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and
sync thread") I missed that libiscsi was now setting the iSCSI class state,
and that patch ended up resetting the state during conn stoppage and using
the wrong state value during ep_disconnect. This patch moves the setting of
the class state to the class module and then fixes the two issues above.

Link: https://lore.kernel.org/r/20210406171746.5016-1-michael.christie@oracle.com
Fixes: 9e67600ed6b8 ("scsi: iscsi: Fix race condition between login and sync thread")
Cc: Gulam Mohamed <gulam.mohamed@oracle.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/libiscsi.c
drivers/scsi/scsi_transport_iscsi.c