Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

David Howells and committed by
Linus Torvalds
509bf24d 607566ae

+1 -1
+1 -1
fs/cachefiles/namei.c
··· 56 56 object->fscache.cookie->parent, 57 57 object->fscache.cookie->netfs_data, 58 58 object->fscache.cookie->flags); 59 - if (keybuf) 59 + if (keybuf && cookie->def) 60 60 keylen = cookie->def->get_key(cookie->netfs_data, keybuf, 61 61 CACHEFILES_KEYBUF_SIZE); 62 62 else