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

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

 



From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>

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

commit 31dd8f6971ad62f4a849d98cafecf23675575e88
Author: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
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().

Reported-by: John Hawley <warthog9@xxxxxxxxxx>
Signed-off-by: Nicholas A. Bellinger <nab@xxxxxxxxxxxxxxx>
---
 drivers/target/target_core_device.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 89b3893..4c2bd9c 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -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);
-- 
1.5.6.5

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux