Skip to content

Commit

Permalink
SUNRPC: Don't dereference xprt->snd_task if it's a cookie
Browse files Browse the repository at this point in the history
[ Upstream commit aed28b7 ]

Fixes: e26d997 ("SUNRPC: Clean up scheduling of autoclose")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
chucklever authored and Sasha Levin committed Feb 1, 2022
1 parent 2036b30 commit df751c5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions include/trace/events/sunrpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,8 @@ TRACE_EVENT(rpc_socket_nospace,
{ BIT(XPRT_REMOVE), "REMOVE" }, \
{ BIT(XPRT_CONGESTED), "CONGESTED" }, \
{ BIT(XPRT_CWND_WAIT), "CWND_WAIT" }, \
{ BIT(XPRT_WRITE_SPACE), "WRITE_SPACE" })
{ BIT(XPRT_WRITE_SPACE), "WRITE_SPACE" }, \
{ BIT(XPRT_SND_IS_COOKIE), "SND_IS_COOKIE" })

DECLARE_EVENT_CLASS(rpc_xprt_lifetime_class,
TP_PROTO(
Expand Down Expand Up @@ -1150,8 +1151,11 @@ DECLARE_EVENT_CLASS(xprt_writelock_event,
__entry->task_id = -1;
__entry->client_id = -1;
}
__entry->snd_task_id = xprt->snd_task ?
xprt->snd_task->tk_pid : -1;
if (xprt->snd_task &&
!test_bit(XPRT_SND_IS_COOKIE, &xprt->state))
__entry->snd_task_id = xprt->snd_task->tk_pid;
else
__entry->snd_task_id = -1;
),

TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
Expand Down Expand Up @@ -1196,8 +1200,12 @@ DECLARE_EVENT_CLASS(xprt_cong_event,
__entry->task_id = -1;
__entry->client_id = -1;
}
__entry->snd_task_id = xprt->snd_task ?
xprt->snd_task->tk_pid : -1;
if (xprt->snd_task &&
!test_bit(XPRT_SND_IS_COOKIE, &xprt->state))
__entry->snd_task_id = xprt->snd_task->tk_pid;
else
__entry->snd_task_id = -1;

__entry->cong = xprt->cong;
__entry->cwnd = xprt->cwnd;
__entry->wait = test_bit(XPRT_CWND_WAIT, &xprt->state);
Expand Down

0 comments on commit df751c5

Please sign in to comment.