linux_dsm_epyc7002/include/trace/events
David Howells 34fa47612b afs: Fix race in async call refcounting
There's a race between afs_make_call() and afs_wake_up_async_call() in the
case that an error is returned from rxrpc_kernel_send_data() after it has
queued the final packet.

afs_make_call() will try and clean up the mess, but the call state may have
been moved on thereby causing afs_process_async_call() to also try and to
delete the call.

Fix this by:

 (1) Getting an extra ref for an asynchronous call for the call itself to
     hold.  This makes sure the call doesn't evaporate on us accidentally
     and will allow the call to be retained by the caller in a future
     patch.  The ref is released on leaving afs_make_call() or
     afs_wait_for_call_to_complete().

 (2) In the event of an error from rxrpc_kernel_send_data():

     (a) Don't set the call state to AFS_CALL_COMPLETE until *after* the
     	 call has been aborted and ended.  This prevents
     	 afs_deliver_to_call() from doing anything with any notifications
     	 it gets.

     (b) Explicitly end the call immediately to prevent further callbacks.

     (c) Cancel any queued async_work and wait for the work if it's
     	 executing.  This allows us to be sure the race won't recur when we
     	 change the state.  We put the work queue's ref on the call if we
     	 managed to cancel it.

     (d) Put the call's ref that we got in (1).  This belongs to us as long
     	 as the call is in state AFS_CALL_CL_REQUESTING.

Fixes: 341f741f04 ("afs: Refcount the afs_call struct")
Signed-off-by: David Howells <dhowells@redhat.com>
2019-01-17 15:17:28 +00:00
..
9p.h
afs.h afs: Fix race in async call refcounting 2019-01-17 15:17:28 +00:00
alarmtimer.h
asoc.h
bcache.h bcache: print number of keys in trace_bcache_journal_write 2018-12-13 08:15:54 -07:00
block.h
bridge.h
btrfs.h btrfs: add new flushing states for the delayed refs rsv 2018-12-17 14:51:47 +01:00
cachefiles.h
cgroup.h
clk.h
cma.h
compaction.h
context_tracking.h
cpuhp.h
devlink.h
dma_fence.h
ext4.h ext4: force inode writes when nfsd calls commit_metadata() 2018-12-19 14:07:58 -05:00
f2fs.h block: add a report_zones method 2018-10-25 11:17:40 -06:00
fib6.h
fib.h
filelock.h fs/locks: rename some lists and pointers. 2018-11-30 11:26:12 -05:00
filemap.h
fs_dax.h
fscache.h
fsi_master_ast_cf.h
fsi_master_gpio.h
fsi.h
gpio.h
host1x.h
hswadsp.h
huge_memory.h
hwmon.h hwmon: (core) Add trace events to _attr_show/store functions 2018-10-11 20:07:35 -07:00
i2c.h
initcall.h
intel_ish.h
intel-sst.h
iommu.h
ipi.h
irq_matrix.h
irq.h
iscsi.h scsi: iscsi: Capture iscsi debug messages using tracepoints 2018-12-20 20:03:55 -05:00
jbd2.h
kmem.h
kvm.h
kyber.h kyber: fix wrong strlcpy() size in trace_kyber_latency() 2018-11-12 08:28:37 -07:00
libata.h
lock.h
mce.h
mdio.h
migrate.h
mmc.h
mmflags.h mm: workingset: tell cache transitions from workingset thrashing 2018-10-26 16:26:32 -07:00
module.h
napi.h
net_probe_common.h
net.h net: Add trace events for all receive exit points 2018-11-30 13:23:25 -08:00
nilfs2.h
nmi.h
objagg.h lib: introduce initial implementation of object aggregation manager 2018-11-15 14:43:43 -08:00
oom.h
page_isolation.h
page_ref.h
pagemap.h
percpu.h
power_cpu_migrate.h
power.h
preemptirq.h
printk.h
qdisc.h
random.h
rcu.h
rdma.h
regulator.h
rpcrdma.h xprtrdma: Prevent leak of rpcrdma_rep objects 2019-01-02 12:05:19 -05:00
rpm.h
rseq.h
rtc.h
rxrpc.h rxrpc: Fix life check 2018-11-15 11:35:40 -08:00
sched.h sched, trace: Fix prev_state output in sched_switch tracepoint 2018-11-27 20:31:55 -05:00
scsi.h
sctp.h
signal.h
siox.h
skb.h
smbus.h
sock.h
spi.h
spmi.h
sunrpc.h NFS client updates for Linux 4.21 2019-01-02 16:35:23 -08:00
sunvnet.h
swiotlb.h
syscalls.h
target.h
task.h
tcp.h
thermal_power_allocator.h
thermal.h
thp.h
timer.h
tlb.h
udp.h
ufs.h
v4l2.h
vb2.h
vmscan.h
vsock_virtio_transport_common.h
wbt.h
workqueue.h
writeback.h
xdp.h
xen.h