summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-linkfile.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/dht/src/dht-linkfile.c')
-rw-r--r--xlators/cluster/dht/src/dht-linkfile.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/xlators/cluster/dht/src/dht-linkfile.c b/xlators/cluster/dht/src/dht-linkfile.c
index 14df3187097..923dde09455 100644
--- a/xlators/cluster/dht/src/dht-linkfile.c
+++ b/xlators/cluster/dht/src/dht-linkfile.c
@@ -312,12 +312,13 @@ dht_linkfile_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int
dht_linkfile_attr_heal (call_frame_t *frame, xlator_t *this)
{
- int ret = -1;
- call_frame_t *copy = NULL;
- dht_local_t *local = NULL;
- dht_local_t *copy_local = NULL;
- xlator_t *subvol = NULL;
- struct iatt stbuf = {0,};
+ int ret = -1;
+ call_frame_t *copy = NULL;
+ dht_local_t *local = NULL;
+ dht_local_t *copy_local = NULL;
+ xlator_t *subvol = NULL;
+ struct iatt stbuf = {0,};
+ dict_t *xattr = NULL;
local = frame->local;
@@ -327,6 +328,8 @@ dht_linkfile_attr_heal (call_frame_t *frame, xlator_t *this)
if (local->stbuf.ia_type == IA_INVAL)
return 0;
+ DHT_MARK_FOP_INTERNAL (xattr);
+
gf_uuid_copy (local->loc.gfid, local->stbuf.ia_gfid);
copy = copy_frame (frame);
@@ -348,8 +351,14 @@ dht_linkfile_attr_heal (call_frame_t *frame, xlator_t *this)
STACK_WIND (copy, dht_linkfile_setattr_cbk, subvol,
subvol->fops->setattr, &copy_local->loc,
- &stbuf, (GF_SET_ATTR_UID | GF_SET_ATTR_GID), NULL);
+ &stbuf, (GF_SET_ATTR_UID | GF_SET_ATTR_GID), xattr);
ret = 0;
out:
+ if ((ret < 0) && (copy))
+ DHT_STACK_DESTROY (copy);
+
+ if (xattr)
+ dict_unref (xattr);
+
return ret;
}