summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/read-only/src/worm-helper.c6
-rw-r--r--xlators/features/read-only/src/worm.c2
-rw-r--r--xlators/features/upcall/src/upcall.c15
3 files changed, 12 insertions, 11 deletions
diff --git a/xlators/features/read-only/src/worm-helper.c b/xlators/features/read-only/src/worm-helper.c
index 61aa4f02651..425e48123b1 100644
--- a/xlators/features/read-only/src/worm-helper.c
+++ b/xlators/features/read-only/src/worm-helper.c
@@ -62,7 +62,7 @@ worm_init_state (xlator_t *this, gf_boolean_t fop_with_fd, void *file_ptr)
NULL);
out:
if (dict)
- dict_destroy (dict);
+ dict_unref (dict);
return ret;
}
@@ -283,7 +283,7 @@ gf_worm_set_xattr (xlator_t *this, worm_reten_state_t *reten_state,
NULL);
out:
if (dict)
- dict_destroy (dict);
+ dict_unref (dict);
return ret;
}
@@ -410,4 +410,4 @@ is_wormfile (xlator_t *this, gf_boolean_t fop_with_fd, void *file_ptr)
dict_unref (dict);
}
return ret;
-} \ No newline at end of file
+}
diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c
index 3e32d65dbac..5ba6641fca2 100644
--- a/xlators/features/read-only/src/worm.c
+++ b/xlators/features/read-only/src/worm.c
@@ -433,7 +433,7 @@ out:
STACK_UNWIND_STRICT (create, frame, op_ret, op_errno, fd, inode, buf,
preparent, postparent, xdata);
if (dict)
- dict_destroy (dict);
+ dict_unref (dict);
return ret;
}
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)