From mboxrd@z Thu Jan 1 00:00:00 1970 From: Milosz Tanski Subject: [PATCH 2/3] FS-Cache: Reduce cookie ref count if submit fails. Date: Wed, 13 Aug 2014 12:58:21 -0400 Message-ID: <53EB992D.6040608@adfin.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, NeilBrown , linux-kernel@vger.kernel.org To: linux-cachefs@redhat.com Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-cachefs-bounces@redhat.com Errors-To: linux-cachefs-bounces@redhat.com List-Id: linux-fsdevel.vger.kernel.org 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 --- fs/fscache/object.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/fscache/object.c b/fs/fscache/object.c index d3b4539..e1eb1f5 100644 --- a/fs/fscache/object.c +++ b/fs/fscache/object.c @@ -982,6 +982,8 @@ nomem: submit_op_failed: clear_bit(FSCACHE_OBJECT_IS_LIVE, &object->flags); spin_unlock(&cookie->lock); + if (__fscache_unuse_cookie(cookie)) + __fscache_wake_unused_cookie(cookie); kfree(op); _leave(" [EIO]"); return transit_to(KILL_OBJECT); -- 1.7.9.5