Commit d0fb31ec authored by David Howells's avatar David Howells
Browse files

fscache: Detect multiple relinquishment of a cookie



Report if an fscache cookie is relinquished multiple times by the netfs.

Signed-off-by: default avatarDavid <dhowells@redhat.com>
parent b27ddd46
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -602,7 +602,8 @@ void __fscache_relinquish_cookie(struct fscache_cookie *cookie, bool retire)
	       atomic_read(&cookie->n_active), retire);
	       atomic_read(&cookie->n_active), retire);


	/* No further netfs-accessing operations on this cookie permitted */
	/* 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);
	__fscache_disable_cookie(cookie, retire);