[PATCH 6/8] target: Issue Power-On/Reset UA upon LUN instantiation

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

 



Whenever a LUN is being assigned we should be sending out an
Power-On/Reset UA.

Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
---
 drivers/target/target_core_device.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 52676a0..88d6070 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -363,9 +363,11 @@ int core_enable_device_list_for_node(
 		rcu_read_lock();
 		hlist_for_each_entry_rcu(tmp, &nacl->lun_entry_hlist, link) {
 			if (tmp == new)
-				continue;
-			core_scsi3_ua_allocate(tmp, 0x3F,
-				ASCQ_3FH_REPORTED_LUNS_DATA_HAS_CHANGED);
+				core_scsi3_ua_allocate(tmp, 0x29,
+					ASCQ_29H_POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURED);
+			else
+				core_scsi3_ua_allocate(tmp, 0x3F,
+					ASCQ_3FH_REPORTED_LUNS_DATA_HAS_CHANGED);
 		}
 		rcu_read_unlock();
 
@@ -385,9 +387,11 @@ int core_enable_device_list_for_node(
 	rcu_read_lock();
 	hlist_for_each_entry_rcu(tmp, &nacl->lun_entry_hlist, link) {
 		if (tmp == new)
-			continue;
-		core_scsi3_ua_allocate(tmp, 0x3F,
-			ASCQ_3FH_REPORTED_LUNS_DATA_HAS_CHANGED);
+			core_scsi3_ua_allocate(tmp, 0x29,
+				ASCQ_29H_POWER_ON_RESET_OR_BUS_DEVICE_RESET_OCCURED);
+		else
+			core_scsi3_ua_allocate(tmp, 0x3F,
+				ASCQ_3FH_REPORTED_LUNS_DATA_HAS_CHANGED);
 	}
 	rcu_read_unlock();
 	return 0;
-- 
1.8.5.2

--
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



[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux