diff mbox

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

Message ID 1434620622-65391-7-git-send-email-hare@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Hannes Reinecke June 18, 2015, 9:43 a.m. UTC
Whenever a LUN is being assigned we should be sending out an
Power-On/Reset UA.

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

Patch

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;