diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2018-10-18 19:35:40 +0800 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-10-22 05:26:56 +0000 |
commit | 826e03db0903abab852bda37d6d77f3dd0f83cc6 (patch) | |
tree | 6982f9ce17d6b16d87b6f37c07e65ffbe10ea915 /xlators | |
parent | 92c22abb440ba8f8025441b16f3811b05927a16d (diff) |
md-cache: fix dict leak of cached xattr
Change-Id: I52f8e13e68528ba9679537ffdddf58ec08f9fd0c
Updates: bz#1634220
Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/performance/md-cache/src/md-cache.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index b151110a081..fc9d601015b 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -2352,6 +2352,9 @@ mdc_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, const char *key, GF_ATOMIC_INC(conf->mdc_counter.xattr_hit); MDC_STACK_UNWIND(getxattr, frame, ret, op_errno, xattr, xdata); + if (xattr) + dict_unref(xattr); + return 0; uncached: @@ -2417,6 +2420,9 @@ mdc_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *key, GF_ATOMIC_INC(conf->mdc_counter.xattr_hit); MDC_STACK_UNWIND(fgetxattr, frame, ret, op_errno, xattr, xdata); + if (xattr) + dict_unref(xattr); + return 0; uncached: @@ -2500,6 +2506,9 @@ mdc_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc, GF_ATOMIC_INC(conf->mdc_counter.xattr_hit); MDC_STACK_UNWIND(removexattr, frame, ret, op_errno, xdata); + if (xattr) + dict_unref(xattr); + return 0; uncached: @@ -2583,6 +2592,10 @@ mdc_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd, GF_ATOMIC_INC(conf->mdc_counter.xattr_hit); MDC_STACK_UNWIND(fremovexattr, frame, ret, op_errno, xdata); + + if (xattr) + dict_unref(xattr); + return 0; uncached: |