linux-stable/include/scsi
Wenchao Hao 6bc564f3fe scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace
[ Upstream commit a3be19b91e ]

It was observed that the kernel would potentially send
ISCSI_KEVENT_UNBIND_SESSION multiple times. Introduce 'target_state' in
iscsi_cls_session() to make sure session will send only one unbind session
event.

This introduces a regression wrt. the issue fixed in commit 13e60d3ba2
("scsi: iscsi: Report unbind session event when the target has been
removed"). If iscsid dies for any reason after sending an unbind session to
kernel, once iscsid is restarted, the kernel's ISCSI_KEVENT_UNBIND_SESSION
event is lost and userspace is then unable to logout. However, the session
is actually in invalid state (its target_id is INVALID) so iscsid should
not sync this session during restart.

Consequently we need to check the session's target state during iscsid
restart.  If session is in unbound state, do not sync this session and
perform session teardown. This is OK because once a session is unbound, we
can not recover it any more (mainly because its target id is INVALID).

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
Link: https://lore.kernel.org/r/20221126010752.231917-1-haowenchao@huawei.com
Reviewed-by: Mike Christie <michael.christie@oracle.com>
Reviewed-by: Wu Bo <wubo40@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-02-01 08:23:16 +01:00
..
fc scsi: fc: Correct RHBA attributes length 2021-07-14 16:56:52 +02:00
fc_encode.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00
fc_frame.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00
fcoe_sysfs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 335 2019-06-05 17:37:06 +02:00
iscsi_if.h scsi: iscsi: Add support for asynchronous iSCSI session destruction 2020-03-11 23:07:57 -04:00
iscsi_proto.h scsi: Revert "target: iscsi: Wait for all commands to finish before freeing a session" 2020-02-14 17:13:54 -05:00
iser.h
libfc.h scsi: libfc: Whitespace cleanup in libfc.h 2019-07-29 20:43:06 -04:00
libfcoe.h scsi: fcoe: Fix Wstringop-overflow warnings in fcoe_wwn_from_mac() 2022-06-09 10:21:15 +02:00
libiscsi.h scsi: iscsi: Stop queueing during ep_disconnect 2022-04-20 09:23:15 +02:00
libiscsi_tcp.h SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
libsas.h scsi: libsas: Introduce a _gfp() variant of event notifiers 2021-03-25 09:04:11 +01:00
sas.h scsi: libsas: Replace zero-length array with flexible-array 2020-05-11 22:26:32 -04:00
sas_ata.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
scsi.h
scsi_bsg_iscsi.h scsi: Replace zero-length array with flexible-array member 2020-03-11 23:07:56 -04:00
scsi_cmnd.h scsi: stex: Properly zero out the passthrough command structure 2022-10-15 07:55:55 +02:00
scsi_common.h scsi: target: core: Add CONTROL field for trace events 2020-10-02 18:36:19 -04:00
scsi_dbg.h scsi: core: Reduce memory required for SCSI logging 2019-08-07 21:47:29 -04:00
scsi_device.h scsi: core: Only re-run queue in scsi_end_request() if device queue is busy 2020-09-15 22:20:11 -04:00
scsi_devinfo.h
scsi_dh.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
scsi_driver.h
scsi_eh.h scsi: core: save/restore command resid for error handling 2019-10-03 21:43:04 -04:00
scsi_host.h scsi: Add host and host template flag 'host_tagset' 2020-10-06 08:33:44 -06:00
scsi_ioctl.h scsi: Replace zero-length array with flexible-array member 2020-03-11 23:07:56 -04:00
scsi_proto.h
scsi_request.h
scsi_tcq.h scsi: core: Only return started requests from scsi_host_find_tag() 2020-07-24 22:09:56 -04:00
scsi_transport.h SCSI misc on 20190709 2019-07-11 15:14:01 -07:00
scsi_transport_fc.h scsi: fc: Add 256GBit speed setting to SCSI FC transport 2020-09-02 22:49:07 -04:00
scsi_transport_iscsi.h scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace 2023-02-01 08:23:16 +01:00
scsi_transport_sas.h
scsi_transport_spi.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 2019-05-30 11:26:35 -07:00
scsi_transport_srp.h
scsicam.h scsi: simplify scsi_partsize 2020-03-24 07:57:07 -06:00
sg.h scsi: docs: convert scsi-generic.txt to ReST 2020-03-11 23:08:02 -04:00
srp.h scsi: Replace zero-length array with flexible-array member 2020-03-11 23:07:56 -04:00
viosrp.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00