From 787202cb9d04d8810d63624027bf3ce6d5d66996 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 25 Apr 2012 15:03:46 -0400 Subject: [PATCH] name cache: skip rename with same src and target fileio tests 214,215 does lots of renames with the same source and target filename. nfs41_name_cache_rename() would operate on the same pointer for both src and existing, and accidentally turn both into a negative entry 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 a4a3182..1ca83e0 100644 --- a/daemon/name_cache.c +++ b/daemon/name_cache.c @@ -1184,6 +1184,8 @@ int nfs41_name_cache_rename( struct name_cache_entry *existing; existing = name_cache_search(cache, dst_parent, dst_name); if (existing) { + if (existing == src) + goto out_unlock; /* remove the existing entry, but don't unlink it yet; * we may reuse it for a negative entry */ name_cache_remove(existing, dst_parent);