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

Showing the changes to include (1 of 1 file). Show all

Unified · Split

include/trace/events/sunrpc.h+13−5
@@ -965,7 +965,8 @@ TRACE_EVENT(rpc_socket_nospace, · 964 unmodified lines
965965 { BIT(XPRT_REMOVE), "REMOVE" }, \
966966 { BIT(XPRT_CONGESTED), "CONGESTED" }, \
967967 { 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" })
969970
970971 DECLARE_EVENT_CLASS(rpc_xprt_lifetime_class,
971972 TP_PROTO(
@@ -1162,8 +1163,11 @@ DECLARE_EVENT_CLASS(xprt_writelock_event, · 190 unmodified lines
11621163 __entry->task_id = -1;
11631164 __entry->client_id = -1;
11641165 }
1165− __entry->snd_task_id = xprt->snd_task ?
1166− xprt->snd_task->tk_pid : -1;
1166+ if (xprt->snd_task &&
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;
11671171 ),
11681172
11691173 TP_printk(SUNRPC_TRACE_TASK_SPECIFIER
@@ -1208,8 +1212,12 @@ DECLARE_EVENT_CLASS(xprt_cong_event, · 38 unmodified lines
12081212 __entry->task_id = -1;
12091213 __entry->client_id = -1;
12101214 }
1211− __entry->snd_task_id = xprt->snd_task ?
1212− xprt->snd_task->tk_pid : -1;
1215+ if (xprt->snd_task &&
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+
12131221 __entry->cong = xprt->cong;
12141222 __entry->cwnd = xprt->cwnd;
12151223 __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