@@ -4383,6 +4383,8 @@ int iscsit_close_session(struct iscsi_session *sess)
}
}
+ target_sysfs_remove_session(sess->se_sess);
+
if (sess->sess_ops->ErrorRecoveryLevel == 2)
iscsit_free_connection_recovery_entries(sess);
@@ -359,6 +359,13 @@ static int iscsi_target_do_tx_login_io(struct iscsi_conn *conn, struct iscsi_log
ISCSI_LOGIN_STATUS_NO_RESOURCES);
return -1;
}
+
+ if (target_sysfs_add_session(&conn->tpg->tpg_se_tpg,
+ conn->sess->se_sess)) {
+ iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR,
+ ISCSI_LOGIN_STATUS_NO_RESOURCES);
+ return -1;
+ }
}
if (conn->conn_transport->iscsit_put_login_tx(conn, login,
@@ -371,6 +378,8 @@ static int iscsi_target_do_tx_login_io(struct iscsi_conn *conn, struct iscsi_log
err:
if (login->login_complete) {
+ target_sysfs_remove_session(conn->sess->se_sess);
+
if (conn->rx_thread && conn->rx_thread_active) {
send_sig(SIGINT, conn->rx_thread, 1);
complete(&conn->rx_login_comp);
Have the iscsi target export it's sessions in sysfs. Signed-off-by: Mike Christie <michael.christie@oracle.com> --- drivers/target/iscsi/iscsi_target.c | 2 ++ drivers/target/iscsi/iscsi_target_nego.c | 9 +++++++++ 2 files changed, 11 insertions(+)