summaryrefslogtreecommitdiffstats
path: root/fs/fscache
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2018-04-04 13:41:26 +0100
committerDavid Howells <dhowells@redhat.com>2018-04-04 13:41:26 +0100
commitd0fb31ecda2c3c6092d0c2a46a6a72653e7dcabb (patch)
treeaf770d5997993875f953f637841ce331ff1f6097 /fs/fscache
parentb27ddd46245311850f850024df54d0537506f3c1 (diff)
downloadlinux-stable-d0fb31ecda2c3c6092d0c2a46a6a72653e7dcabb.tar.gz
linux-stable-d0fb31ecda2c3c6092d0c2a46a6a72653e7dcabb.tar.bz2
linux-stable-d0fb31ecda2c3c6092d0c2a46a6a72653e7dcabb.zip
fscache: Detect multiple relinquishment of a cookie
Report if an fscache cookie is relinquished multiple times by the netfs. Signed-off-by: David <dhowells@redhat.com>
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/cookie.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/fscache/cookie.c b/fs/fscache/cookie.c
index d705125665f0..98d22f495cd8 100644
--- a/fs/fscache/cookie.c
+++ b/fs/fscache/cookie.c
@@ -602,7 +602,8 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, bool retire)
atomic_read(&cookie->n_active), retire);
/* No further netfs-accessing operations on this cookie permitted */
- set_bit(FSCACHE_COOKIE_RELINQUISHED, &cookie->flags);
+ if (test_and_set_bit(FSCACHE_COOKIE_RELINQUISHED, &cookie->flags))
+ BUG();
__fscache_disable_cookie(cookie, retire);