| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /****************************************************************************** |
|---|
| 2 | 3 | * This file contains error recovery level zero functions used by |
|---|
| 3 | 4 | * the iSCSI Target driver. |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Author: Nicholas A. Bellinger <nab@linux-iscsi.org> |
|---|
| 8 | 9 | * |
|---|
| 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. |
|---|
| 18 | 10 | ******************************************************************************/ |
|---|
| 19 | 11 | |
|---|
| 20 | 12 | #include <linux/sched/signal.h> |
|---|
| .. | .. |
|---|
| 770 | 762 | |
|---|
| 771 | 763 | pr_err("Time2Retain timer expired for SID: %u, cleaning up" |
|---|
| 772 | 764 | " iSCSI session.\n", sess->sid); |
|---|
| 773 | | - { |
|---|
| 774 | | - struct iscsi_tiqn *tiqn = tpg->tpg_tiqn; |
|---|
| 775 | 765 | |
|---|
| 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); |
|---|
| 788 | 767 | spin_unlock_bh(&se_tpg->session_lock); |
|---|
| 789 | 768 | iscsit_close_session(sess); |
|---|
| 790 | 769 | } |
|---|
| .. | .. |
|---|
| 815 | 794 | jiffies + sess->sess_ops->DefaultTime2Retain * HZ); |
|---|
| 816 | 795 | } |
|---|
| 817 | 796 | |
|---|
| 818 | | -/* |
|---|
| 819 | | - * Called with spin_lock_bh(&struct se_portal_group->session_lock) held |
|---|
| 820 | | - */ |
|---|
| 821 | 797 | int iscsit_stop_time2retain_timer(struct iscsi_session *sess) |
|---|
| 822 | 798 | { |
|---|
| 823 | 799 | struct iscsi_portal_group *tpg = sess->tpg; |
|---|
| 824 | 800 | struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; |
|---|
| 825 | 801 | |
|---|
| 802 | + lockdep_assert_held(&se_tpg->session_lock); |
|---|
| 803 | + |
|---|
| 826 | 804 | if (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED) |
|---|
| 827 | 805 | return -1; |
|---|
| 828 | 806 | |
|---|