Matthew DeVore has uploaded this change for review.

View Change

mdcache: do not remove sentinel ref in cih module

Currently, the sentinel reference of an mdcache entry can be removed in
_state_del_locked (see last line in that function) as well as in
cih_remove_checked.

After the last ref is removed, mdcache_lru_unref calls mdcache_lru_clean
which calls mdc_clean_entry which calls cih_remove_checked, which
attempts to 'put' the reference again, which finally leads to the -1 ref
count.

Other calls to cih_remove checked have been amended with a put ref,
except one; mdc_up_try_release also tries to remove the sentinel ref
twice: once through cih_remove_latched and again explicitly right before
returning. This can also cause the refcnt to become negative, so its
use of cih_remove_latched need not be amended with another put ref.

Change-Id: I34caf72092b4c743b7b94450a24cbefcb442f1f0
Signed-off-by: Matthew DeVore <matvore@google.com>
---
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_hash.h
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_helpers.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_lru.c
3 files changed, 15 insertions(+), 23 deletions(-)

git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha refs/changes/07/505607/1

To view, visit change 505607. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I34caf72092b4c743b7b94450a24cbefcb442f1f0
Gerrit-Change-Number: 505607
Gerrit-PatchSet: 1
Gerrit-Owner: Matthew DeVore <matvore@google.com>
Gerrit-MessageType: newchange