Skip to content

Commit 0be283f

Browse files
bcodding-rhtrondmy
authored andcommitted
SUNRPC: Fix null rpc_clnt dereference in rpc_task_queued tracepoint
Backchannel tasks will not have a reference to the rpc_clnt. Return -1 for cl_clid in that case. Signed-off-by: Benjamin Coddington <[email protected]> Signed-off-by: Trond Myklebust <[email protected]>
1 parent 49686cb commit 0be283f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/trace/events/sunrpc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ DECLARE_EVENT_CLASS(rpc_task_queued,
175175
),
176176

177177
TP_fast_assign(
178-
__entry->client_id = clnt->cl_clid;
178+
__entry->client_id = clnt ? clnt->cl_clid : -1;
179179
__entry->task_id = task->tk_pid;
180180
__entry->timeout = task->tk_timeout;
181181
__entry->runstate = task->tk_runstate;
@@ -184,7 +184,7 @@ DECLARE_EVENT_CLASS(rpc_task_queued,
184184
__assign_str(q_name, rpc_qname(q));
185185
),
186186

187-
TP_printk("task:%u@%u flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s",
187+
TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s",
188188
__entry->task_id, __entry->client_id,
189189
__entry->flags,
190190
__entry->runstate,

0 commit comments

Comments
 (0)