summaryrefslogtreecommitdiffstats
path: root/xlators/features/upcall/src/upcall.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-01-06 14:30:08 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-07-25 23:47:33 -0700
commitd2bd17e5a53d0ffa375df1a5ad957556be2f2b83 (patch)
tree872633e25252817ee332d0b64a92cd64eba7464b /xlators/features/upcall/src/upcall.c
parent558a45fa527b01ec81904150532a8b661c06ae8a (diff)
dict: Don't expose get_new_dict/dict_destroy
get_new_dict/dict_destroy is causing confusion where, dict_new/dict_destroy or get_new_dict/dict_unref are used instead of dict_new/dict_unref. Change-Id: I4cc69f5b6711d720823395e20fd624a0c6c1168c BUG: 1296043 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/13183 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'xlators/features/upcall/src/upcall.c')
-rw-r--r--xlators/features/upcall/src/upcall.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/xlators/features/upcall/src/upcall.c b/xlators/features/upcall/src/upcall.c
index 76f8ee4923d..40cfb6c7f11 100644
--- a/xlators/features/upcall/src/upcall.c
+++ b/xlators/features/upcall/src/upcall.c
@@ -1641,6 +1641,7 @@ up_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
op_errno = ENOMEM;
goto err;
}
+ dict_unref (xattr);
out:
STACK_WIND (frame, up_setxattr_cbk, FIRST_CHILD(this),
@@ -1650,6 +1651,8 @@ out:
return 0;
err:
+ if (xattr)
+ dict_unref (xattr);
UPCALL_STACK_UNWIND (setxattr, frame, -1, op_errno, NULL);
return 0;
@@ -1719,6 +1722,7 @@ up_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
op_errno = ENOMEM;
goto err;
}
+ dict_unref (xattr);
out:
STACK_WIND (frame, up_fsetxattr_cbk,
@@ -1728,6 +1732,8 @@ out:
return 0;
err:
+ if (xattr)
+ dict_unref (xattr);
UPCALL_STACK_UNWIND (fsetxattr, frame, -1, op_errno, NULL);
return 0;
@@ -2010,13 +2016,8 @@ upcall_local_wipe (xlator_t *this, upcall_local_t *local)
{
if (local) {
inode_unref (local->inode);
- if (local->xattr) {
- /* There will be 2 refs at this point, hence dict_destroy:
- * 1. taken by dict_copy_with_ref
- * 2. taken by upcall_local_init ()
- */
- dict_destroy (local->xattr);
- }
+ if (local->xattr)
+ dict_unref (local->xattr);
loc_wipe (&local->rename_oldloc);
loc_wipe (&local->loc);
if (local->fd)