From 61ddf671fa2f2d7d32c7f8166272d35f99f1ee0f Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 11 Oct 2010 16:06:19 -0400 Subject: [PATCH] name cache: remove changes entry to negative instead of calling name_cache_entry_unlink(), nfs41_name_cache_remove() calls name_cache_entry_update() with NULL for fh and info to make it a negative entry, then name_cache_unlink_children_recursive() to remove any children Signed-off-by: Casey Bodley --- daemon/name_cache.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/daemon/name_cache.c b/daemon/name_cache.c index ec1eb64..8ee26f7 100644 --- a/daemon/name_cache.c +++ b/daemon/name_cache.c @@ -994,8 +994,12 @@ int nfs41_name_cache_remove( if (status == ERROR_FILE_NOT_FOUND) goto out_unlock; - target->attributes->numlinks--; - name_cache_unlink(cache, target); + if (target->attributes) + target->attributes->numlinks--; + + /* make this a negative entry and unlink children */ + name_cache_entry_update(cache, target, NULL, NULL); + name_cache_unlink_children_recursive(cache, target); out_unlock: ReleaseSRWLockExclusive(&cache->lock);