FS-Cache: Reduce cookie ref count if submit fails.
authorMilosz Tanski <milosz@adfin.com>
Wed, 13 Aug 2014 16:58:21 +0000 (12:58 -0400)
committerDavid Howells <dhowells@redhat.com>
Wed, 27 Aug 2014 14:29:34 +0000 (15:29 +0100)
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>
fs/fscache/object.c

index d3b4539..da032da 100644 (file)
@@ -982,6 +982,7 @@ nomem:
 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);