Skip to contentSkip to conversation

target: Call missing list_del() for demo-mode MappedLUN disable

PATCH New Nicholas A. Bellinger 1 participant 1 message Jan 20, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target: Call missing list_del() for demo-mode MappedLUN disable

From: Nicholas Bellinger <[email protected]>

This patch fixes a v4.0 specific bug that was not properly addressed in commit 31dd8f6971ad:

commit 31dd8f6971ad62f4a849d98cafecf23675575e88

Author: Nicholas Bellinger <[email protected]>
Date:   Sun Jan 16 20:50:54 2011 -0800

target: Fix demo-mode MappedLUN shutdown UA/PR breakage

The main point is that list_del(&deve->alua_port_list); *must* be called via core_update_device_list_for_node() for each demo-mode struct se_node_acl specific MappedLUN that is being disabled when a dynamic struct se_node_acl->device_list[] is being released in core_free_device_list_for_node().

---
 drivers/target/target_core_device.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)
drivers/target/target_core_device.c +5 -6
index 89b3893..4c2bd9c 100644
@@ -369,15 +369,14 @@ int core_update_device_list_for_node(
 		/*
 		 * deve->se_lun_acl will be NULL for demo-mode created LUNs
 		 * that have not been explictly concerted to MappedLUNs ->
-		 * struct se_lun_acl.  This means that active UAs and
+		 * struct se_lun_acl, but we remove deve->alua_port_list from
+		 * port->sep_alua_list. This also means that active UAs and
 		 * NodeACL context specific PR metadata for demo-mode
 		 * MappedLUN *deve will be released below..
 		 */
-		if (deve->se_lun_acl != NULL) {
-			spin_lock_bh(&port->sep_alua_lock);
-			list_del(&deve->alua_port_list);
-			spin_unlock_bh(&port->sep_alua_lock);
-		}
+		spin_lock_bh(&port->sep_alua_lock);
+		list_del(&deve->alua_port_list);
+		spin_unlock_bh(&port->sep_alua_lock);
 	}
 
 	spin_lock_irq(&nacl->device_list_lock);
Signature · 1 line
1.5.6.5