From 28032a030908be7b91fa5fe199160957df606303 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Tue, 16 Aug 2011 15:44:14 -0400 Subject: [PATCH] namecache: bug fix for name_cache_insert() once the attribute cache fills up with delegated entries, attr_cache_find_or_create() will start returning ERROR_OUTOFMEMORY. this is a problem for nfs41_name_cache_insert(), because name_cache_find_or_create() will succeed and then name_cache_entry_update() will fail. this leaves behind a name cache entry with attributes=NULL, which is treated like a negative entry and causes later lookups to fail with ERROR_FILE_NOT_FOUND added a call to name_cache_entry_invalidate() to clean up this entry if name_cache_entry_update() fails Signed-off-by: Casey Bodley --- daemon/name_cache.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daemon/name_cache.c b/daemon/name_cache.c index 5802a1a..c34a365 100644 --- a/daemon/name_cache.c +++ b/daemon/name_cache.c @@ -895,6 +895,8 @@ int nfs41_name_cache_insert( goto out_err_deleg; status = name_cache_entry_update(cache, target, fh, info, delegation); + if (status) + name_cache_entry_invalidate(cache, target); out_unlock: ReleaseSRWLockExclusive(&cache->lock);