diff options
author | David Howells <dhowells@redhat.com> | 2017-11-02 16:27:53 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-11-13 16:38:21 +0100 |
commit | 98bf40cd99fcfed0705812b6cbdbb3b441a42970 (patch) | |
tree | e0108e6306a6fde29bf7d5348f730922a18dc2b1 /include/trace/events/afs.h | |
parent | afs: Trace page dirty/clean (diff) | |
download | linux-98bf40cd99fcfed0705812b6cbdbb3b441a42970.tar.xz linux-98bf40cd99fcfed0705812b6cbdbb3b441a42970.zip |
afs: Protect call->state changes against signals
Protect call->state changes against the call being prematurely terminated
due to a signal.
What can happen is that a signal causes afs_wait_for_call_to_complete() to
abort an afs_call because it's not yet complete whilst afs_deliver_to_call()
is delivering data to that call.
If the data delivery causes the state to change, this may overwrite the state
of the afs_call, making it not-yet-complete again - but no further
notifications will be forthcoming from AF_RXRPC as the rxrpc call has been
aborted and completed, so kAFS will just hang in various places waiting for
that call or on page bits that need clearing by that call.
A tracepoint to monitor call state changes is also provided.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/trace/events/afs.h')
-rw-r--r-- | include/trace/events/afs.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/include/trace/events/afs.h b/include/trace/events/afs.h index 5f4e8193932d..6b59c63a8e51 100644 --- a/include/trace/events/afs.h +++ b/include/trace/events/afs.h @@ -441,6 +441,36 @@ TRACE_EVENT(afs_page_dirty, __entry->priv >> AFS_PRIV_SHIFT) ); +TRACE_EVENT(afs_call_state, + TP_PROTO(struct afs_call *call, + enum afs_call_state from, + enum afs_call_state to, + int ret, u32 remote_abort), + + TP_ARGS(call, from, to, ret, remote_abort), + + TP_STRUCT__entry( + __field(struct afs_call *, call ) + __field(enum afs_call_state, from ) + __field(enum afs_call_state, to ) + __field(int, ret ) + __field(u32, abort ) + ), + + TP_fast_assign( + __entry->call = call; + __entry->from = from; + __entry->to = to; + __entry->ret = ret; + __entry->abort = remote_abort; + ), + + TP_printk("c=%p %u->%u r=%d ab=%d", + __entry->call, + __entry->from, __entry->to, + __entry->ret, __entry->abort) + ); + #endif /* _TRACE_AFS_H */ /* This part must be outside protection */ |