SUNRPC: Fix null rpc_clnt dereference in rpc_task_queued tracepoint
authorBenjamin Coddington <bcodding@redhat.com>
Tue, 23 Jan 2018 14:32:35 +0000 (09:32 -0500)
committerTrond Myklebust <trondmy@gmail.com>
Tue, 23 Jan 2018 18:18:11 +0000 (13:18 -0500)
Backchannel tasks will not have a reference to the rpc_clnt.  Return -1 for
cl_clid in that case.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Trond Myklebust <trondmy@gmail.com>
include/trace/events/sunrpc.h

index 8c153f68509e297225db7614f8e706479476bb9c..1357ec8973d5aae03412ba0e4a36ae85d8f10368 100644 (file)
@@ -175,7 +175,7 @@ DECLARE_EVENT_CLASS(rpc_task_queued,
                ),
 
        TP_fast_assign(
-               __entry->client_id = clnt->cl_clid;
+               __entry->client_id = clnt ? clnt->cl_clid : -1;
                __entry->task_id = task->tk_pid;
                __entry->timeout = task->tk_timeout;
                __entry->runstate = task->tk_runstate;
@@ -184,7 +184,7 @@ DECLARE_EVENT_CLASS(rpc_task_queued,
                __assign_str(q_name, rpc_qname(q));
                ),
 
-       TP_printk("task:%u@%u flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s",
+       TP_printk("task:%u@%d flags=%4.4x state=%4.4lx status=%d timeout=%lu queue=%s",
                __entry->task_id, __entry->client_id,
                __entry->flags,
                __entry->runstate,