namecache: cleanup name_cache_entry_update()
added goto out on attr_cache_find_or_create() failure to avoid calling name_cache_entry_updated() Signed-off-by: Casey Bodley <cbodley@citi.umich.edu>
This commit is contained in:
parent
a4b39031b9
commit
ead5bc78a2
1 changed files with 17 additions and 15 deletions
|
|
@ -502,12 +502,14 @@ static int name_cache_entry_update(
|
|||
entry->fh.len = 0;
|
||||
|
||||
if (info) {
|
||||
if (entry->attributes == NULL) {
|
||||
/* negative -> positive entry, create the attributes */
|
||||
if (entry->attributes == NULL)
|
||||
status = attr_cache_find_or_create(&cache->attributes,
|
||||
info->fileid, &entry->attributes);
|
||||
if (status)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (status == NO_ERROR) {
|
||||
attr_cache_update(entry->attributes, info, delegation);
|
||||
|
||||
/* hold a reference as long as we have the delegation */
|
||||
|
|
@ -519,13 +521,13 @@ static int name_cache_entry_update(
|
|||
/* keep the entry from expiring */
|
||||
if (entry->attributes->delegated)
|
||||
list_remove(&entry->exp_entry);
|
||||
}
|
||||
} else if (entry->attributes) {
|
||||
/* positive -> negative entry, deref the attributes */
|
||||
attr_cache_entry_deref(&cache->attributes, entry->attributes);
|
||||
entry->attributes = NULL;
|
||||
}
|
||||
name_cache_entry_updated(cache, entry);
|
||||
out:
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue