Commit 5482d56b authored by Lance Digby's avatar Lance Digby Committed by Martin K. Petersen

scsi: target: core: 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.

Link: https://lore.kernel.org/r/9b13bb2e1f52f1792cd81850ee95bf3781bb5363.1589759816.git.lance.digby@gmail.comReviewed-by: default avatarMike Christie <mchristi@redhat.com>
Signed-off-by: default avatarLance Digby <lance.digby@gmail.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 1cdee004
...@@ -100,9 +100,10 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun) ...@@ -100,9 +100,10 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun)
*/ */
if (unpacked_lun != 0) { if (unpacked_lun != 0) {
pr_err("TARGET_CORE[%s]: Detected NON_EXISTENT_LUN" 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, se_cmd->se_tfo->fabric_name,
unpacked_lun); unpacked_lun,
nacl->initiatorname);
return TCM_NON_EXISTENT_LUN; return TCM_NON_EXISTENT_LUN;
} }
...@@ -174,9 +175,10 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd, u64 unpacked_lun) ...@@ -174,9 +175,10 @@ int transport_lookup_tmr_lun(struct se_cmd *se_cmd, u64 unpacked_lun)
if (!se_lun) { if (!se_lun) {
pr_debug("TARGET_CORE[%s]: Detected NON_EXISTENT_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, se_cmd->se_tfo->fabric_name,
unpacked_lun); unpacked_lun,
nacl->initiatorname);
return -ENODEV; return -ENODEV;
} }
se_cmd->se_dev = rcu_dereference_raw(se_lun->lun_se_dev); se_cmd->se_dev = rcu_dereference_raw(se_lun->lun_se_dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment