History

SUNRPC: Don't dereference xprt->snd_task if it's a cookie

Chuck Lever committed 4 years ago

Commit aed28b71 parent c0f26161 file · +13 −5Browse files

Unified · Split

include/trace/events/sunrpc.h+13−5
@@ -965,7 +965,8 @@ TRACE_EVENT(rpc_socket_nospace, · 964 unmodified lines
965 { BIT(XPRT_REMOVE), "REMOVE" }, \965 { BIT(XPRT_REMOVE), "REMOVE" }, \
966 { BIT(XPRT_CONGESTED), "CONGESTED" }, \966 { BIT(XPRT_CONGESTED), "CONGESTED" }, \
967 { BIT(XPRT_CWND_WAIT), "CWND_WAIT" }, \967 { BIT(XPRT_CWND_WAIT), "CWND_WAIT" }, \
968 { BIT(XPRT_WRITE_SPACE), "WRITE_SPACE" })968 { BIT(XPRT_WRITE_SPACE), "WRITE_SPACE" }, \
969 { BIT(XPRT_SND_IS_COOKIE), "SND_IS_COOKIE" })
969 970
970DECLARE_EVENT_CLASS(rpc_xprt_lifetime_class,971DECLARE_EVENT_CLASS(rpc_xprt_lifetime_class,
971 TP_PROTO(972 TP_PROTO(
@@ -1162,8 +1163,11 @@ DECLARE_EVENT_CLASS(xprt_writelock_event, · 190 unmodified lines
1162 __entry->task_id = -1;1163 __entry->task_id = -1;
1163 __entry->client_id = -1;1164 __entry->client_id = -1;
1164 }1165 }
1165 __entry->snd_task_id = xprt->snd_task ?1166 if (xprt->snd_task &&
1166 xprt->snd_task->tk_pid : -1;1167 !test_bit(XPRT_SND_IS_COOKIE, &xprt->state))
1168 __entry->snd_task_id = xprt->snd_task->tk_pid;
1169 else
1170 __entry->snd_task_id = -1;
1167 ),1171 ),
1168 1172
1169 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER1173 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
@@ -1208,8 +1212,12 @@ DECLARE_EVENT_CLASS(xprt_cong_event, · 38 unmodified lines
1208 __entry->task_id = -1;1212 __entry->task_id = -1;
1209 __entry->client_id = -1;1213 __entry->client_id = -1;
1210 }1214 }
1211 __entry->snd_task_id = xprt->snd_task ?1215 if (xprt->snd_task &&
1212 xprt->snd_task->tk_pid : -1;1216 !test_bit(XPRT_SND_IS_COOKIE, &xprt->state))
1217 __entry->snd_task_id = xprt->snd_task->tk_pid;
1218 else
1219 __entry->snd_task_id = -1;
1220
1213 __entry->cong = xprt->cong;1221 __entry->cong = xprt->cong;
1214 __entry->cwnd = xprt->cwnd;1222 __entry->cwnd = xprt->cwnd;
1215 __entry->wait = test_bit(XPRT_CWND_WAIT, &xprt->state);1223 __entry->wait = test_bit(XPRT_CWND_WAIT, &xprt->state);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t