public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SUNRPC: Fix oops in the rpc_xdr_buf event class
@ 2020-11-12 20:17 Scott Mayhew
  2020-11-12 20:21 ` Scott Mayhew
  2020-11-12 20:39 ` Chuck Lever
  0 siblings, 2 replies; 4+ messages in thread
From: Scott Mayhew @ 2020-11-12 20:17 UTC (permalink / raw)
  To: chuck.lever, bfields; +Cc: linux-nfs

Backchannel rpc tasks don't have task->tk_client set, so it's necessary
to check it for NULL before dereferencing.

Fixes: c509f15a5801 ("SUNRPC: Split the xdr_buf event class")

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 include/trace/events/sunrpc.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/trace/events/sunrpc.h b/include/trace/events/sunrpc.h
index 2477014e3fa6..2a03263b5f9d 100644
--- a/include/trace/events/sunrpc.h
+++ b/include/trace/events/sunrpc.h
@@ -68,7 +68,8 @@ DECLARE_EVENT_CLASS(rpc_xdr_buf_class,
 
 	TP_fast_assign(
 		__entry->task_id = task->tk_pid;
-		__entry->client_id = task->tk_client->cl_clid;
+		__entry->client_id = task->tk_client ?
+				     task->tk_client->cl_clid : -1;
 		__entry->head_base = xdr->head[0].iov_base;
 		__entry->head_len = xdr->head[0].iov_len;
 		__entry->tail_base = xdr->tail[0].iov_base;
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-12 21:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-12 20:17 [PATCH] SUNRPC: Fix oops in the rpc_xdr_buf event class Scott Mayhew
2020-11-12 20:21 ` Scott Mayhew
2020-11-12 20:39 ` Chuck Lever
2020-11-12 21:03   ` Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox