Skip to contentSkip to conversation

target: Add initiatorname to NON_EXISTENT_LUN error

PATCH Applied Lance Digby 3 participants 3 messages May 18, 2020 – May 20, 2020

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

PATCH 1/1 target: Add initiatorname to NON_EXISTENT_LUN error

The NON_EXISTENT_LUN error can be written without an error condition on the initiator responsible. Adding the initiatorname to this message will reduce the effort required to fix this when many initiators are supported by a target.

This version ensures the initiator name is also printed on the same message in transport_lookup_tmr_lun for consistency.

---
 drivers/target/target_core_device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/target/target_core_device.c +6 -4
index 4cee113..15064a5 100644
@@ -100,9 +100,10 @@
 		 */
 		if (unpacked_lun != 0) {
 			pr_err("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN"
-				" Access for 0x%08llx\n",
+				" Access for 0x%08llx from %s\n",
 				se_cmd->se_tfo->fabric_name,
-				unpacked_lun);
+				unpacked_lun,
+				nacl->initiatorname);
 			return TCM_NON_EXISTENT_LUN;
 		}
 
@@ -174,9 +175,10 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd, u64 unpacked_lun)
 
 	if (!se_lun) {
 		pr_debug("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN"
-			" Access for 0x%08llx\n",
+			" Access for 0x%08llx for %s\n",
 			se_cmd->se_tfo->fabric_name,
-			unpacked_lun);
+			unpacked_lun,
+			nacl->initiatorname);
 		return -ENODEV;
 	}
 	se_cmd->se_dev = rcu_dereference_raw(se_lun->lun_se_dev);
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Lance Digby

The NON_EXISTENT_LUN error can be written without an error condition on the initiator responsible. Adding the initiatorname to this message will reduce the effort required to fix this when many initiators are supported by a target.

This version ensures the initiator name is also printed on the same message in transport_lookup_tmr_lun for consistency.

#2 lore raw
In reply to Lance Digby
Quoted 7 lines · Lance Digby

The NON_EXISTENT_LUN error can be written without an error condition on the initiator responsible. Adding the initiatorname to this message will reduce the effort required to fix this when many initiators are supported by a target.

This version ensures the initiator name is also printed on the same message in transport_lookup_tmr_lun for consistency.

Applied to 5.8/scsi-queue, thanks!

[1/1] scsi: target: core: Add initiatorname to NON_EXISTENT_LUN error

      https://git.kernel.org/mkp/scsi/c/5482d56bfedf
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering