From: David Howells Date: Thu, 20 Dec 2012 21:52:33 +0000 (+0000) Subject: FS-Cache: Check that there are no read ops when cookie relinquished X-Git-Tag: v3.8-rc1~13^2~28^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f972b5696c0a0677a9b3a18fee45cc0e8de4184;p=platform%2Fupstream%2Fkernel-adaptation-pc.git 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 --- diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c index 9905350..0666996 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) _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);