Malahal has uploaded this change for review.

View Change

Fix ACL refcount leak

mdcache_is_referral() takes attrs parameter. This is probably to aid
in detecting an object has a referral or not, and the caller doesn't
care to release the passed in attr. mdcache_is_referral() fills in
attrs with ACL by calling fsal_copy_attrs() and no one releases such
an ACL ref.

mdcache_is_referral() doesn't need attrs parameter as it is the
custodian of attribute cache but sub-FSALs may need it. Made it as
unused parameter for mdcache_is_referral().

Also...

mdcache_readdir_chunked() calls populate_dirent (via cb()) with
'entry->attrs' without holding any lock. populate_dirent() calls
nfs4_readdir_callback(via state->cb) which inturn calls
mdcache_is_referral() which may call fsal_common_is_referral() which
could change attributes and the acl pointer without holding any lock!

Change-Id: I4f15acbcd4b2c0bb049f19c29346d4248085df20
Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
---
M src/FSAL/FSAL_GPFS/fsal_convert.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_handle.c
M src/FSAL/Stackable_FSALs/FSAL_MDCACHE/mdcache_helpers.c
M src/include/fsal.h
4 files changed, 11 insertions(+), 3 deletions(-)

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

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

Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-Change-Id: I4f15acbcd4b2c0bb049f19c29346d4248085df20
Gerrit-Change-Number: 496199
Gerrit-PatchSet: 1
Gerrit-Owner: Malahal <malahal@gmail.com>
Gerrit-MessageType: newchange