Skip to content

Commit

Permalink
FS-Cache: Reduce cookie ref count if submit fails.
Browse files Browse the repository at this point in the history
I've been seeing issues with disposing cookies under vma pressure. The symptom
is that the refcount gets out of sync. In this case we fail to decrement the
refcount if submit fails. I found this while auditing the error in and around
cookie operations.

Signed-off-by: Milosz Tanski <milosz@adfin.com>
Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
Milosz Tanski authored and David Howells committed Aug 27, 2014
1 parent 9776de9 commit 920bce2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/fscache/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,7 @@ static const struct fscache_state *_fscache_invalidate_object(struct fscache_obj
submit_op_failed:
clear_bit(FSCACHE_OBJECT_IS_LIVE, &object->flags);
spin_unlock(&cookie->lock);
fscache_unuse_cookie(object);
kfree(op);
_leave(" [EIO]");
return transit_to(KILL_OBJECT);
Expand Down

0 comments on commit 920bce2

Please sign in to comment.