[PATCH 1/3] target: Allow transport_deregister_session() w/ NULL se_node_acl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>

This patch allows transport_deregister_session() to be called again with a
NULL se_node_acl pointer in order to handle fabric discovery sessions
(from iscsi-target) where this pointer may not be set.  This reverts the
BUG_ON() + re-adds pointer checks from lio-core commit:

commit 888ec69da603d32fcccacedcc662870e2d504925
Author: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
Date:   Mon Feb 27 01:41:54 2012 -0800

    target: Make dynamic NodeACL shutdown clear comp_nacl bit

Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
 drivers/target/target_core_transport.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 0db5d2c..e224096 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -394,10 +394,9 @@ void transport_deregister_session(struct se_session *se_sess)
 	 * struct se_node_acl if it had been previously dynamically generated.
 	se_nacl = se_sess->se_node_acl;
-	BUG_ON(!se_nacl);
 	spin_lock_irqsave(&se_tpg->acl_node_lock, flags);
-	if (se_nacl->dynamic_node_acl) {
+	if (se_nacl && se_nacl->dynamic_node_acl) {
 		if (!se_tfo->tpg_check_demo_mode_cache(se_tpg)) {
@@ -420,8 +419,9 @@ void transport_deregister_session(struct se_session *se_sess)
 	 * Awake sleeping ->acl_free_comp caller from configfs se_node_acl
 	 * removal context
-	if (comp_nacl)
+	if (se_nacl && comp_nacl == true)

To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Photos]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

Add to Google Powered by Linux