linux/include/scsi
Wenchao Hao 28e4e8ca9e 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:27:16 +01:00
..
fc
fc_frame.h
fcoe_sysfs.h
iscsi_if.h
iscsi_proto.h
iser.h
libfc.h
libfcoe.h
libiscsi.h scsi: iscsi: Add recv workqueue helpers 2022-10-26 12:35:15 +02:00
libiscsi_tcp.h
libsas.h
sas.h
sas_ata.h
scsi.h
scsi_bsg_iscsi.h
scsi_cmnd.h
scsi_common.h
scsi_dbg.h
scsi_device.h
scsi_devinfo.h
scsi_dh.h
scsi_driver.h
scsi_eh.h
scsi_host.h
scsi_ioctl.h
scsi_proto.h
scsi_request.h
scsi_status.h
scsi_tcq.h
scsi_transport.h
scsi_transport_fc.h
scsi_transport_iscsi.h scsi: iscsi: Fix multiple iSCSI session unbind events sent to userspace 2023-02-01 08:27:16 +01:00
scsi_transport_sas.h
scsi_transport_spi.h
scsi_transport_srp.h
scsicam.h
sg.h
srp.h
viosrp.h