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 <cbodley@citi.umich.edu>
This commit is contained in:
Casey Bodley 2011-08-16 15:44:14 -04:00 committed by unknown
parent bd21801819
commit 28032a0309

View file

@ -895,6 +895,8 @@ int nfs41_name_cache_insert(
goto out_err_deleg; goto out_err_deleg;
status = name_cache_entry_update(cache, target, fh, info, delegation); status = name_cache_entry_update(cache, target, fh, info, delegation);
if (status)
name_cache_entry_invalidate(cache, target);
out_unlock: out_unlock:
ReleaseSRWLockExclusive(&cache->lock); ReleaseSRWLockExclusive(&cache->lock);