aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cachefiles/interface.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cachefiles/interface.c')
-rw-r--r--fs/cachefiles/interface.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/cachefiles/interface.c b/fs/cachefiles/interface.c
index 3d763217faf3..eeb3f7d0e1a7 100644
--- a/fs/cachefiles/interface.c
+++ b/fs/cachefiles/interface.c
@@ -212,20 +212,29 @@ static void cachefiles_update_object(struct fscache_object *_object)
212 object = container_of(_object, struct cachefiles_object, fscache); 212 object = container_of(_object, struct cachefiles_object, fscache);
213 cache = container_of(object->fscache.cache, struct cachefiles_cache, 213 cache = container_of(object->fscache.cache, struct cachefiles_cache,
214 cache); 214 cache);
215
216 if (!fscache_use_cookie(_object)) {
217 _leave(" [relinq]");
218 return;
219 }
220
215 cookie = object->fscache.cookie; 221 cookie = object->fscache.cookie;
216 222
217 if (!cookie->def->get_aux) { 223 if (!cookie->def->get_aux) {
224 fscache_unuse_cookie(_object);
218 _leave(" [no aux]"); 225 _leave(" [no aux]");
219 return; 226 return;
220 } 227 }
221 228
222 auxdata = kmalloc(2 + 512 + 3, cachefiles_gfp); 229 auxdata = kmalloc(2 + 512 + 3, cachefiles_gfp);
223 if (!auxdata) { 230 if (!auxdata) {
231 fscache_unuse_cookie(_object);
224 _leave(" [nomem]"); 232 _leave(" [nomem]");
225 return; 233 return;
226 } 234 }
227 235
228 auxlen = cookie->def->get_aux(cookie->netfs_data, auxdata->data, 511); 236 auxlen = cookie->def->get_aux(cookie->netfs_data, auxdata->data, 511);
237 fscache_unuse_cookie(_object);
229 ASSERTCMP(auxlen, <, 511); 238 ASSERTCMP(auxlen, <, 511);
230 239
231 auxdata->len = auxlen + 1; 240 auxdata->len = auxlen + 1;
@@ -263,7 +272,7 @@ static void cachefiles_drop_object(struct fscache_object *_object)
263#endif 272#endif
264 273
265 /* delete retired objects */ 274 /* delete retired objects */
266 if (test_bit(FSCACHE_OBJECT_RETIRE, &object->fscache.flags) && 275 if (test_bit(FSCACHE_COOKIE_RETIRED, &object->fscache.cookie->flags) &&
267 _object != cache->cache.fsdef 276 _object != cache->cache.fsdef
268 ) { 277 ) {
269 _debug("- retire object OBJ%x", object->fscache.debug_id); 278 _debug("- retire object OBJ%x", object->fscache.debug_id);