diff options
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_configfs.c')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_configfs.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index b4bfd706ac94..634ad3662ed6 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c | |||
@@ -725,11 +725,8 @@ static ssize_t lio_target_nacl_cmdsn_depth_store(struct config_item *item, | |||
725 | 725 | ||
726 | if (iscsit_get_tpg(tpg) < 0) | 726 | if (iscsit_get_tpg(tpg) < 0) |
727 | return -EINVAL; | 727 | return -EINVAL; |
728 | /* | 728 | |
729 | * iscsit_tpg_set_initiator_node_queue_depth() assumes force=1 | 729 | ret = core_tpg_set_initiator_node_queue_depth(se_nacl, cmdsn_depth); |
730 | */ | ||
731 | ret = iscsit_tpg_set_initiator_node_queue_depth(tpg, | ||
732 | config_item_name(acl_ci), cmdsn_depth, 1); | ||
733 | 730 | ||
734 | pr_debug("LIO_Target_ConfigFS: %s/%s Set CmdSN Window: %u for" | 731 | pr_debug("LIO_Target_ConfigFS: %s/%s Set CmdSN Window: %u for" |
735 | "InitiatorName: %s\n", config_item_name(wwn_ci), | 732 | "InitiatorName: %s\n", config_item_name(wwn_ci), |
@@ -871,6 +868,7 @@ DEF_TPG_ATTRIB(default_erl); | |||
871 | DEF_TPG_ATTRIB(t10_pi); | 868 | DEF_TPG_ATTRIB(t10_pi); |
872 | DEF_TPG_ATTRIB(fabric_prot_type); | 869 | DEF_TPG_ATTRIB(fabric_prot_type); |
873 | DEF_TPG_ATTRIB(tpg_enabled_sendtargets); | 870 | DEF_TPG_ATTRIB(tpg_enabled_sendtargets); |
871 | DEF_TPG_ATTRIB(login_keys_workaround); | ||
874 | 872 | ||
875 | static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = { | 873 | static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = { |
876 | &iscsi_tpg_attrib_attr_authentication, | 874 | &iscsi_tpg_attrib_attr_authentication, |
@@ -886,6 +884,7 @@ static struct configfs_attribute *lio_target_tpg_attrib_attrs[] = { | |||
886 | &iscsi_tpg_attrib_attr_t10_pi, | 884 | &iscsi_tpg_attrib_attr_t10_pi, |
887 | &iscsi_tpg_attrib_attr_fabric_prot_type, | 885 | &iscsi_tpg_attrib_attr_fabric_prot_type, |
888 | &iscsi_tpg_attrib_attr_tpg_enabled_sendtargets, | 886 | &iscsi_tpg_attrib_attr_tpg_enabled_sendtargets, |
887 | &iscsi_tpg_attrib_attr_login_keys_workaround, | ||
889 | NULL, | 888 | NULL, |
890 | }; | 889 | }; |
891 | 890 | ||
@@ -1593,42 +1592,31 @@ static int lio_tpg_check_prot_fabric_only( | |||
1593 | } | 1592 | } |
1594 | 1593 | ||
1595 | /* | 1594 | /* |
1596 | * Called with spin_lock_irq(struct se_portal_group->session_lock) held | 1595 | * This function calls iscsit_inc_session_usage_count() on the |
1597 | * or not held. | ||
1598 | * | ||
1599 | * Also, this function calls iscsit_inc_session_usage_count() on the | ||
1600 | * struct iscsi_session in question. | 1596 | * struct iscsi_session in question. |
1601 | */ | 1597 | */ |
1602 | static int lio_tpg_shutdown_session(struct se_session *se_sess) | 1598 | static int lio_tpg_shutdown_session(struct se_session *se_sess) |
1603 | { | 1599 | { |
1604 | struct iscsi_session *sess = se_sess->fabric_sess_ptr; | 1600 | struct iscsi_session *sess = se_sess->fabric_sess_ptr; |
1605 | struct se_portal_group *se_tpg = se_sess->se_tpg; | 1601 | struct se_portal_group *se_tpg = &sess->tpg->tpg_se_tpg; |
1606 | bool local_lock = false; | ||
1607 | |||
1608 | if (!spin_is_locked(&se_tpg->session_lock)) { | ||
1609 | spin_lock_irq(&se_tpg->session_lock); | ||
1610 | local_lock = true; | ||
1611 | } | ||
1612 | 1602 | ||
1603 | spin_lock_bh(&se_tpg->session_lock); | ||
1613 | spin_lock(&sess->conn_lock); | 1604 | spin_lock(&sess->conn_lock); |
1614 | if (atomic_read(&sess->session_fall_back_to_erl0) || | 1605 | if (atomic_read(&sess->session_fall_back_to_erl0) || |
1615 | atomic_read(&sess->session_logout) || | 1606 | atomic_read(&sess->session_logout) || |
1616 | (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED)) { | 1607 | (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED)) { |
1617 | spin_unlock(&sess->conn_lock); | 1608 | spin_unlock(&sess->conn_lock); |
1618 | if (local_lock) | 1609 | spin_unlock_bh(&se_tpg->session_lock); |
1619 | spin_unlock_irq(&sess->conn_lock); | ||
1620 | return 0; | 1610 | return 0; |
1621 | } | 1611 | } |
1622 | atomic_set(&sess->session_reinstatement, 1); | 1612 | atomic_set(&sess->session_reinstatement, 1); |
1613 | atomic_set(&sess->session_fall_back_to_erl0, 1); | ||
1623 | spin_unlock(&sess->conn_lock); | 1614 | spin_unlock(&sess->conn_lock); |
1624 | 1615 | ||
1625 | iscsit_stop_time2retain_timer(sess); | 1616 | iscsit_stop_time2retain_timer(sess); |
1626 | spin_unlock_irq(&se_tpg->session_lock); | 1617 | spin_unlock_bh(&se_tpg->session_lock); |
1627 | 1618 | ||
1628 | iscsit_stop_session(sess, 1, 1); | 1619 | iscsit_stop_session(sess, 1, 1); |
1629 | if (!local_lock) | ||
1630 | spin_lock_irq(&se_tpg->session_lock); | ||
1631 | |||
1632 | return 1; | 1620 | return 1; |
1633 | } | 1621 | } |
1634 | 1622 | ||