scsi: iscsi: Report connection state in sysfs
authorGabriel Krisman Bertazi <krisman@collabora.com>
Tue, 17 Mar 2020 23:34:22 +0000 (19:34 -0400)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 27 Mar 2020 01:59:20 +0000 (21:59 -0400)
commit82b8cf40bfe1077d8d757e223eb7a35c25f650ec
tree4b64d91b9f716319f26e1c2a125c90c7eac6ab75
parent1a0275239ed6437ee4412c89070bd4222cfe0611
scsi: iscsi: Report connection state in sysfs

If an iSCSI connection happens to fail while the daemon isn't running (due
to a crash or for another reason), the kernel failure report is not
received.  When the daemon restarts, there is insufficient kernel state in
sysfs for it to know that this happened.  open-iscsi tries to reopen every
connection, but on different initiators, we'd like to know which
connections have failed.

There is session->state, but that has a different lifetime than an iSCSI
connection, so it doesn't directly reflect the connection state.

[mkp: typos]

Link: https://lore.kernel.org/r/20200317233422.532961-1-krisman@collabora.com
Cc: Khazhismel Kumykov <khazhy@google.com>
Suggested-by: Junho Ryu <jayr@google.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libiscsi.c
drivers/scsi/scsi_transport_iscsi.c
include/scsi/scsi_transport_iscsi.h