]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: iscsi: Report unbind session event when the target has been removed
authorWu Bo <wubo40@huawei.com>
Tue, 24 Mar 2020 07:58:50 +0000 (15:58 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Apr 2020 14:32:59 +0000 (16:32 +0200)
commit8c71bb2dbd064e9f023f9f2a7cb768a4b34dd2af
tree6a2ea6ae0eb2afc4e1380f675fe8b98416991d44
parent58b78f6a9f73523f490d233fefcc52e624c7b6d5
scsi: iscsi: Report unbind session event when the target has been removed

[ Upstream commit e8218fe414d475802316e096cf95a0e948f56739 ]

If the daemon is restarted or crashes while logging out of a session, the
unbind session event sent by the kernel is not processed and is lost.  When
the daemon starts again, the session can't be unbound because the daemon is
waiting for the event message. However, the kernel has already logged out
and the event will not be resent.

When iscsid restart is complete, logout session reports error:

Logging out of session [sid: 6, target: iqn.xxxxx, portal: xx.xx.xx.xx,3260]
iscsiadm: Could not logout of [sid: 6, target: iscsiadm -m node iqn.xxxxx, portal: xx.xx.xx.xx,3260].
iscsiadm: initiator reported error (9 - internal error)
iscsiadm: Could not logout of all requested sessions

Make sure the unbind event is emitted.

[mkp: commit desc and applied by hand since patch was mangled]

Link: https://lore.kernel.org/r/4eab1771-2cb3-8e79-b31c-923652340e99@huawei.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Wu Bo <wubo40@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/scsi_transport_iscsi.c