Skip to content

Commit

Permalink
FS-Cache: Check that there are no read ops when cookie relinquished
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Howells committed Dec 20, 2012
1 parent 5f4f9f4 commit 0f972b5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fs/fscache/cookie.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,14 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, int retire)

_debug("RELEASE OBJ%x", object->debug_id);

if (atomic_read(&object->n_reads)) {
spin_unlock(&cookie->lock);
printk(KERN_ERR "FS-Cache:"
" Cookie '%s' still has %d outstanding reads\n",
cookie->def->name, atomic_read(&object->n_reads));
BUG();
}

/* detach each cache object from the object cookie */
spin_lock(&object->lock);
hlist_del_init(&object->cookie_link);
Expand Down

0 comments on commit 0f972b5

Please sign in to comment.