aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2013-10-08 12:47:22 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2013-10-09 04:54:44 -0400
commit2053a1db41193c2b5e1f47a91aaba0fd63ba7102 (patch)
tree544cf5b3067cb554e11c2bcc0dd8aa9d6230758a /include
parentacb3f2600eb8cdd35643a8b9237719ce61c98d41 (diff)
target: Fix assignment of LUN in tracepoints
The unpacked_lun field in the SCSI target tracepoints should be initialized with cmd->orig_fe_lun rather than cmd->se_lun->unpacked_lun for two reasons: - most importantly, if we are in the cmd_complete tracepoint returning a check condition due to no LUN found, cmd->se_lun will be NULL and we'll crash trying to dereference it. - also, in any case, cmd->se_lun->unpacked_lun is an internal index into the target's internal set of LUNs; cmd->orig_fe_lun is much more useful and interesting, since it's the value the initiator actually sent. Signed-off-by: Roland Dreier <roland@purestorage.com> Cc: <stable@vger.kernel.org> # 3.11+ Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'include')
-rw-r--r--include/trace/events/target.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/trace/events/target.h b/include/trace/events/target.h
index aef8fc354025..da9cc0f05c93 100644
--- a/include/trace/events/target.h
+++ b/include/trace/events/target.h
@@ -144,7 +144,7 @@ TRACE_EVENT(target_sequencer_start,
144 ), 144 ),
145 145
146 TP_fast_assign( 146 TP_fast_assign(
147 __entry->unpacked_lun = cmd->se_lun->unpacked_lun; 147 __entry->unpacked_lun = cmd->orig_fe_lun;
148 __entry->opcode = cmd->t_task_cdb[0]; 148 __entry->opcode = cmd->t_task_cdb[0];
149 __entry->data_length = cmd->data_length; 149 __entry->data_length = cmd->data_length;
150 __entry->task_attribute = cmd->sam_task_attr; 150 __entry->task_attribute = cmd->sam_task_attr;
@@ -182,7 +182,7 @@ TRACE_EVENT(target_cmd_complete,
182 ), 182 ),
183 183
184 TP_fast_assign( 184 TP_fast_assign(
185 __entry->unpacked_lun = cmd->se_lun->unpacked_lun; 185 __entry->unpacked_lun = cmd->orig_fe_lun;
186 __entry->opcode = cmd->t_task_cdb[0]; 186 __entry->opcode = cmd->t_task_cdb[0];
187 __entry->data_length = cmd->data_length; 187 __entry->data_length = cmd->data_length;
188 __entry->task_attribute = cmd->sam_task_attr; 188 __entry->task_attribute = cmd->sam_task_attr;