aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fscache/cookie.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2012-12-20 16:52:33 -0500
committerDavid Howells <dhowells@redhat.com>2012-12-20 16:58:25 -0500
commit0f972b5696c0a0677a9b3a18fee45cc0e8de4184 (patch)
tree3cde9016353e20e4c52cc01a652bb87461809520 /fs/fscache/cookie.c
parent5f4f9f4af185d5e76c966d2d3420a61870c856e7 (diff)
FS-Cache: Check that there are no read ops when cookie relinquished
Check that the netfs isn't trying to relinquish a cookie that still has read operations in progress upon it. If there are, then give log a warning and BUG. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache/cookie.c')
-rw-r--r--fs/fscache/cookie.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
index 990535071a8a..0666996adf80 100644
--- a/fs/fscache/cookie.c
+++ b/fs/fscache/cookie.c
@@ -452,6 +452,14 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire)
452 452
453 _debug("RELEASE OBJ%x", object->debug_id); 453 _debug("RELEASE OBJ%x", object->debug_id);
454 454
455 if (atomic_read(&object->n_reads)) {
456 spin_unlock(&cookie->lock);
457 printk(KERN_ERR "FS-Cache:"
458 " Cookie '%s' still has %d outstanding reads\n",
459 cookie->def->name, atomic_read(&object->n_reads));
460 BUG();
461 }
462
455 /* detach each cache object from the object cookie */ 463 /* detach each cache object from the object cookie */
456 spin_lock(&object->lock); 464 spin_lock(&object->lock);
457 hlist_del_init(&object->cookie_link); 465 hlist_del_init(&object->cookie_link);