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>
This commit is contained in:

committed by
Martin K. Petersen

parent
1a0275239e
commit
82b8cf40bf
@@ -3153,13 +3153,18 @@ void iscsi_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
|
||||
|
||||
switch (flag) {
|
||||
case STOP_CONN_RECOVER:
|
||||
cls_conn->state = ISCSI_CONN_FAILED;
|
||||
break;
|
||||
case STOP_CONN_TERM:
|
||||
iscsi_start_session_recovery(session, conn, flag);
|
||||
cls_conn->state = ISCSI_CONN_DOWN;
|
||||
break;
|
||||
default:
|
||||
iscsi_conn_printk(KERN_ERR, conn,
|
||||
"invalid stop flag %d\n", flag);
|
||||
return;
|
||||
}
|
||||
|
||||
iscsi_start_session_recovery(session, conn, flag);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(iscsi_conn_stop);
|
||||
|
||||
|
Reference in New Issue
Block a user