Skip to content

Commit 509bf24

Browse files
dhowellstorvalds
authored andcommitted
CacheFiles: Don't try to dump the index key if the cookie has been cleared
Don't try to dump the index key that distinguishes an object if netfs data in the cookie the object refers to has been cleared (ie. the cookie has passed most of the way through __fscache_relinquish_cookie()). Since the netfs holds the index key, we can't get at it once the ->def and ->netfs_data pointers have been cleared - and a NULL pointer exception will ensue, usually just after a: CacheFiles: Error: Unexpected object collision error is reported. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 607566a commit 509bf24

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/cachefiles/namei.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ void __cachefiles_printk_object(struct cachefiles_object *object,
5656
object->fscache.cookie->parent,
5757
object->fscache.cookie->netfs_data,
5858
object->fscache.cookie->flags);
59-
if (keybuf)
59+
if (keybuf && cookie->def)
6060
keylen = cookie->def->get_key(cookie->netfs_data, keybuf,
6161
CACHEFILES_KEYBUF_SIZE);
6262
else

0 commit comments

Comments
 (0)