forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/target/iscsi/iscsi_target_erl0.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /******************************************************************************
23 * This file contains error recovery level zero functions used by
34 * the iSCSI Target driver.
....@@ -6,15 +7,6 @@
67 *
78 * Author: Nicholas A. Bellinger <nab@linux-iscsi.org>
89 *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
1810 ******************************************************************************/
1911
2012 #include <linux/sched/signal.h>
....@@ -770,21 +762,8 @@
770762
771763 pr_err("Time2Retain timer expired for SID: %u, cleaning up"
772764 " iSCSI session.\n", sess->sid);
773
- {
774
- struct iscsi_tiqn *tiqn = tpg->tpg_tiqn;
775765
776
- if (tiqn) {
777
- spin_lock(&tiqn->sess_err_stats.lock);
778
- strcpy(tiqn->sess_err_stats.last_sess_fail_rem_name,
779
- (void *)sess->sess_ops->InitiatorName);
780
- tiqn->sess_err_stats.last_sess_failure_type =
781
- ISCSI_SESS_ERR_CXN_TIMEOUT;
782
- tiqn->sess_err_stats.cxn_timeout_errors++;
783
- atomic_long_inc(&sess->conn_timeout_errors);
784
- spin_unlock(&tiqn->sess_err_stats.lock);
785
- }
786
- }
787
-
766
+ iscsit_fill_cxn_timeout_err_stats(sess);
788767 spin_unlock_bh(&se_tpg->session_lock);
789768 iscsit_close_session(sess);
790769 }
....@@ -815,14 +794,13 @@
815794 jiffies + sess->sess_ops->DefaultTime2Retain * HZ);
816795 }
817796
818
-/*
819
- * Called with spin_lock_bh(&struct se_portal_group->session_lock) held
820
- */
821797 int iscsit_stop_time2retain_timer(struct iscsi_session *sess)
822798 {
823799 struct iscsi_portal_group *tpg = sess->tpg;
824800 struct se_portal_group *se_tpg = &tpg->tpg_se_tpg;
825801
802
+ lockdep_assert_held(&se_tpg->session_lock);
803
+
826804 if (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED)
827805 return -1;
828806