Skip to content

Commit

Permalink
Merge branch 'tp/ibm_next_may10' into ibm_next_tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
Venkateswararao Jujjuri committed May 10, 2012
2 parents a190069 + 787106b commit f91576c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/Cache_inode/cache_inode_lru.c
Expand Up @@ -536,6 +536,7 @@ lru_try_reap_entry(struct lru_q_base *q)
if (lru->refcount > LRU_SENTINEL_REFCOUNT + 1) {
/* Someone took a reference while we were waiting for the
queue. */
--(lru->refcount);
pthread_mutex_unlock(&lru->mtx);
pthread_mutex_unlock(&q->mtx);
return NULL;
Expand Down Expand Up @@ -1161,6 +1162,7 @@ cache_inode_lru_get(cache_inode_client_t *client,
"pthread_mutex_init of lru.mtx returned %d (%s)",
errno,
strerror(errno));
entry = NULL;
*status = CACHE_INODE_INIT_ENTRY_FAILED;
goto out;
}
Expand Down
3 changes: 2 additions & 1 deletion src/Cache_inode/cache_inode_misc.c
Expand Up @@ -265,6 +265,7 @@ cache_inode_new_entry(cache_inode_fsal_data_t *fsdata,
*status = CACHE_INODE_MALLOC_ERROR;
goto out;
}
assert(entry->lru.refcount > 1);
/* This should be the sentinel, plus one to use the entry we
just returned. */
lrurefed = TRUE;
Expand Down Expand Up @@ -444,7 +445,7 @@ cache_inode_new_entry(cache_inode_fsal_data_t *fsdata,
if (latched) {
HashTable_ReleaseLatched(fh_to_cache_entry_ht, &latch);
}
if (lrurefed) {
if (lrurefed && *status != CACHE_INODE_ENTRY_EXISTS) {
cache_inode_lru_unref(entry, client, LRU_FLAG_NONE);
}
if (*status != CACHE_INODE_ENTRY_EXISTS) {
Expand Down

0 comments on commit f91576c

Please sign in to comment.