Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292858
b: refs/heads/master
c: 337c060
h: refs/heads/master
v: v3
  • Loading branch information
Nicholas Bellinger committed Mar 10, 2012
1 parent f72fdcf commit 8cb9584
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: afb999ffc48f5e7ec18e6f8f9e68aa3d0085862d
refs/heads/master: 337c060701fb3d27d9945bf7af7ba194ae2153a8
44 changes: 26 additions & 18 deletions trunk/drivers/target/target_core_tpg.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,10 @@ int core_tpg_del_initiator_node_acl(
struct se_node_acl *acl,
int force)
{
LIST_HEAD(sess_list);
struct se_session *sess, *sess_tmp;
unsigned long flags;
int dynamic_acl = 0;
int dynamic_acl = 0, rc;

spin_lock_irq(&tpg->acl_node_lock);
if (acl->dynamic_node_acl) {
Expand All @@ -465,27 +466,34 @@ int core_tpg_del_initiator_node_acl(
tpg->num_node_acls--;
spin_unlock_irq(&tpg->acl_node_lock);

spin_lock_irqsave(&tpg->session_lock, flags);
list_for_each_entry_safe(sess, sess_tmp,
&tpg->tpg_sess_list, sess_list) {
if (sess->se_node_acl != acl)
continue;
/*
* Determine if the session needs to be closed by our context.
*/
if (!tpg->se_tpg_tfo->shutdown_session(sess))
spin_lock_irqsave(&acl->nacl_sess_lock, flags);
acl->acl_stop = 1;

list_for_each_entry_safe(sess, sess_tmp, &acl->acl_sess_list,
sess_acl_list) {
if (sess->sess_tearing_down != 0)
continue;

spin_unlock_irqrestore(&tpg->session_lock, flags);
/*
* If the $FABRIC_MOD session for the Initiator Node ACL exists,
* forcefully shutdown the $FABRIC_MOD session/nexus.
*/
tpg->se_tpg_tfo->close_session(sess);
target_get_session(sess);
list_move(&sess->sess_acl_list, &sess_list);
}
spin_unlock_irqrestore(&acl->nacl_sess_lock, flags);

list_for_each_entry_safe(sess, sess_tmp, &sess_list, sess_acl_list) {
list_del(&sess->sess_acl_list);

spin_lock_irqsave(&tpg->session_lock, flags);
rc = tpg->se_tpg_tfo->shutdown_session(sess);
target_put_session(sess);
if (!rc)
continue;
target_put_session(sess);
}
spin_unlock_irqrestore(&tpg->session_lock, flags);
target_put_nacl(acl);
/*
* Wait for last target_put_nacl() to complete in target_complete_nacl()
* for active fabric session transport_deregister_session() callbacks.
*/
wait_for_completion(&acl->acl_free_comp);

core_tpg_wait_for_nacl_pr_ref(acl);
core_clear_initiator_node_from_tpg(acl, tpg);
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,8 @@ void transport_deregister_session_configfs(struct se_session *se_sess)
se_nacl = se_sess->se_node_acl;
if (se_nacl) {
spin_lock_irqsave(&se_nacl->nacl_sess_lock, flags);
list_del(&se_sess->sess_acl_list);
if (se_nacl->acl_stop == 0)
list_del(&se_sess->sess_acl_list);
/*
* If the session list is empty, then clear the pointer.
* Otherwise, set the struct se_session pointer from the tail
Expand Down
1 change: 1 addition & 0 deletions trunk/include/target/target_core_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ struct se_node_acl {
char initiatorname[TRANSPORT_IQN_LEN];
/* Used to signal demo mode created ACL, disabled by default */
bool dynamic_node_acl;
bool acl_stop:1;
u32 queue_depth;
u32 acl_index;
u64 num_cmds;
Expand Down

0 comments on commit 8cb9584

Please sign in to comment.