Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tcm_loop: Send I_T_NEXUS_LOSS_OCCURRED UA

If the virtual SAS link is set to 'offline' we should be
queueing an I_T_NEXUS_LOSS_OCCURRED UA.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>

authored by

Hannes Reinecke and committed by
Nicholas Bellinger
e986a35a b7446cac

+23
+5
drivers/target/loopback/tcm_loop.c
··· 1034 1034 } 1035 1035 if (!strncmp(page, "offline", 7)) { 1036 1036 tl_tpg->tl_transport_status = TCM_TRANSPORT_OFFLINE; 1037 + if (tl_tpg->tl_nexus) { 1038 + struct se_session *tl_sess = tl_tpg->tl_nexus->se_sess; 1039 + 1040 + core_allocate_nexus_loss_ua(tl_sess->se_node_acl); 1041 + } 1037 1042 return count; 1038 1043 } 1039 1044 return -EINVAL;
+17
drivers/target/target_core_tpg.c
··· 41 41 #include "target_core_internal.h" 42 42 #include "target_core_alua.h" 43 43 #include "target_core_pr.h" 44 + #include "target_core_ua.h" 44 45 45 46 extern struct se_device *g_lun0_dev; 46 47 ··· 83 82 return acl; 84 83 } 85 84 EXPORT_SYMBOL(core_tpg_get_initiator_node_acl); 85 + 86 + void core_allocate_nexus_loss_ua( 87 + struct se_node_acl *nacl) 88 + { 89 + struct se_dev_entry *deve; 90 + 91 + if (!nacl) 92 + return; 93 + 94 + rcu_read_lock(); 95 + hlist_for_each_entry_rcu(deve, &nacl->lun_entry_hlist, link) 96 + core_scsi3_ua_allocate(deve, 0x29, 97 + ASCQ_29H_NEXUS_LOSS_OCCURRED); 98 + rcu_read_unlock(); 99 + } 100 + EXPORT_SYMBOL(core_allocate_nexus_loss_ua); 86 101 87 102 /* core_tpg_add_node_to_devs(): 88 103 *
+1
include/target/target_core_fabric.h
··· 152 152 void transport_generic_request_failure(struct se_cmd *, sense_reason_t); 153 153 void __target_execute_cmd(struct se_cmd *); 154 154 int transport_lookup_tmr_lun(struct se_cmd *, u64); 155 + void core_allocate_nexus_loss_ua(struct se_node_acl *acl); 155 156 156 157 struct se_node_acl *core_tpg_get_initiator_node_acl(struct se_portal_group *tpg, 157 158 unsigned char *);