Skip to content

Commit

Permalink
fscache: Detect multiple relinquishment of a cookie
Browse files Browse the repository at this point in the history
Report if an fscache cookie is relinquished multiple times by the netfs.

Signed-off-by: David <[email protected]>
  • Loading branch information
dhowells committed Apr 4, 2018
1 parent b27ddd4 commit d0fb31e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/fscache/cookie.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d0fb31e

Please sign in to comment.