linux/include
Dave Wysochanski 6e9bfdcf0a cachefiles: Fix oops in trace_cachefiles_mark_buried due to NULL object
In cachefiles_mark_object_buried, the dentry in question may not have an
owner, and thus our cachefiles_object pointer may be NULL when calling
the tracepoint, in which case we will also not have a valid debug_id to
print in the tracepoint.

Check for NULL object in the tracepoint and if so, just set debug_id to
MAX_UINT as was done in 2908f5e101 ("fscache: Add a cookie debug ID
and use that in traces").

This fixes the following oops:

    FS-Cache: Cache "mycache" added (type cachefiles)
    CacheFiles: File cache on vdc registered
    ...
    Workqueue: fscache_object fscache_object_work_func [fscache]
    RIP: 0010:trace_event_raw_event_cachefiles_mark_buried+0x4e/0xa0 [cachefiles]
    ....
    Call Trace:
     cachefiles_mark_object_buried+0xa5/0xb0 [cachefiles]
     cachefiles_bury_object+0x270/0x430 [cachefiles]
     cachefiles_walk_to_object+0x195/0x9c0 [cachefiles]
     cachefiles_lookup_object+0x5a/0xc0 [cachefiles]
     fscache_look_up_object+0xd7/0x160 [fscache]
     fscache_object_work_func+0xb2/0x340 [fscache]
     process_one_work+0x1f1/0x390
     worker_thread+0x53/0x3e0
     kthread+0x127/0x150

Fixes: 2908f5e101 ("fscache: Add a cookie debug ID and use that in traces")
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-cachefs@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-10-02 10:03:28 -07:00
..
acpi Revert "ACPI: Add memory semantics to acpi_os_map_memory()" 2021-09-23 20:39:36 +02:00
asm-generic pci_iounmap'2: Electric Boogaloo: try to make sense of it all 2021-09-19 17:13:35 -07:00
clocksource
crypto
drm
dt-bindings linux-watchdog 5.15-rc1 tag 2021-09-07 13:52:46 -07:00
keys
kunit
kvm KVM: arm64: Fix PMU probe ordering 2021-09-20 12:43:34 +01:00
linux Networking fixes for 5.15-rc4, including fixes from mac80211, netfilter 2021-09-30 14:28:05 -07:00
math-emu
media
memory
misc
net af_unix: fix races in sk_peer_pid and sk_peer_cred accesses 2021-09-30 14:18:40 +01:00
pcmcia
ras
rdma
scsi scsi: core: Remove 'current_tag' 2021-09-22 00:13:38 -04:00
soc
sound ALSA: rawmidi: introduce SNDRV_RAWMIDI_IOCTL_USER_PVERSION 2021-09-23 09:26:40 +02:00
target
trace cachefiles: Fix oops in trace_cachefiles_mark_buried due to NULL object 2021-10-02 10:03:28 -07:00
uapi sound fixes for 5.15-rc4 2021-09-29 07:48:00 -07:00
vdso
video
xen swiotlb-xen: this is PV-only on x86 2021-09-20 17:01:21 +02:00