linux/fs/fscache
David Howells 33cba85922 fscache: Fix fscache_cookie_put() to not deref after dec
fscache_cookie_put() accesses the cookie it has just put inside the
tracepoint that monitors the change - but this is something it's not
allowed to do if we didn't reduce the count to zero.

Fix this by dropping most of those values from the tracepoint and grabbing
the cookie debug ID before doing the dec.

Also take the opportunity to switch over the usage and where arguments on
the tracepoint to put the reason last.

Fixes: a18feb5576 ("fscache: Add tracepoints")
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
cc: linux-cachefs@redhat.com
Link: https://lore.kernel.org/r/162431203107.2908479.3259582550347000088.stgit@warthog.procyon.org.uk/
2021-08-27 13:34:02 +01:00
..
cache.c fscache: Change %p in format strings to something else 2021-08-27 13:34:02 +01:00
cookie.c fscache: Fix fscache_cookie_put() to not deref after dec 2021-08-27 13:34:02 +01:00
fsdef.c fscache: Add a cookie debug ID and use that in traces 2021-08-27 13:24:46 +01:00
internal.h fscache: Fix fscache_cookie_put() to not deref after dec 2021-08-27 13:34:02 +01:00
io.c fscache, cachefiles: Add alternate API to use kiocb for read/write to cache 2021-04-23 10:14:32 +01:00
Kconfig fscache: Remove the object list procfile 2021-08-27 13:34:02 +01:00
main.c fscache: Fix cookie key hashing 2021-08-27 13:34:02 +01:00
Makefile fscache: Remove the object list procfile 2021-08-27 13:34:02 +01:00
netfs.c fscache: Fix fscache_cookie_put() to not deref after dec 2021-08-27 13:34:02 +01:00
object.c fscache: Change %p in format strings to something else 2021-08-27 13:34:02 +01:00
operation.c fscache, cachefiles: Remove the histogram stuff 2021-08-27 13:34:02 +01:00
page.c fscache, cachefiles: Remove the histogram stuff 2021-08-27 13:34:02 +01:00
proc.c fscache, cachefiles: Remove the histogram stuff 2021-08-27 13:34:02 +01:00
stats.c fscache, cachefiles: Add alternate API to use kiocb for read/write to cache 2021-04-23 10:14:32 +01:00