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 <cbodley@citi.umich.edu>
This commit is contained in:
parent
beb33855e0
commit
787202cb9d
1 changed files with 2 additions and 0 deletions
|
|
@ -1184,6 +1184,8 @@ int nfs41_name_cache_rename(
|
||||||
struct name_cache_entry *existing;
|
struct name_cache_entry *existing;
|
||||||
existing = name_cache_search(cache, dst_parent, dst_name);
|
existing = name_cache_search(cache, dst_parent, dst_name);
|
||||||
if (existing) {
|
if (existing) {
|
||||||
|
if (existing == src)
|
||||||
|
goto out_unlock;
|
||||||
/* remove the existing entry, but don't unlink it yet;
|
/* remove the existing entry, but don't unlink it yet;
|
||||||
* we may reuse it for a negative entry */
|
* we may reuse it for a negative entry */
|
||||||
name_cache_remove(existing, dst_parent);
|
name_cache_remove(existing, dst_parent);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue