linux-stable/fs/fscache
Jeff Layton fb24771faf fscache: don't leak cookie access refs if invalidation is in progress or failed
It's possible for a request to invalidate a fscache_cookie will come in
while we're already processing an invalidation. If that happens we
currently take an extra access reference that will leak. Only call
__fscache_begin_cookie_access if the FSCACHE_COOKIE_DO_INVALIDATE bit
was previously clear.

Also, ensure that we attempt to clear the bit when the cookie is
"FAILED" and put the reference to avoid an access leak.

Fixes: 85e4ea1049 ("fscache: Fix invalidation/lookup race")
Suggested-by: David Howells <dhowells@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: David Howells <dhowells@redhat.com>
2022-08-09 14:13:55 +01:00
..
cache.c fscache: Use wrapper fscache_set_cache_state() directly when relinquishing 2022-04-08 23:54:37 +01:00
cookie.c fscache: don't leak cookie access refs if invalidation is in progress or failed 2022-08-09 14:13:55 +01:00
internal.h fscache: Move fscache_cookies_seq_ops specific code under CONFIG_PROC_FS 2022-04-08 23:54:37 +01:00
io.c fscache: Remove the cookie parameter from fscache_clear_page_bits() 2022-04-08 23:54:37 +01:00
Kconfig fscache: remove FSCACHE_OLD_API Kconfig option 2022-04-08 23:54:37 +01:00
main.c fscache: Implement cookie-level access helpers 2022-01-07 09:22:19 +00:00
Makefile fscache: Provide a means to begin an operation 2022-01-07 09:22:19 +00:00
proc.c fscache: Implement cookie registration 2022-01-07 09:22:19 +00:00
stats.c fscache, cachefiles: Display stat of culling events 2022-01-07 13:43:18 +00:00
volume.c fscache: Fix if condition in fscache_wait_on_volume_collision() 2022-07-05 16:12:20 +01:00