summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index 579915f78bf..1374b1c5bf9 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -1092,12 +1092,16 @@ afr_sh_entry_impunge_parent_setattr_cbk (call_frame_t *setattr_frame,
{
loc_t *parent_loc = cookie;
- gf_log (this->name, GF_LOG_DEBUG,
- "setattr on directory %s failed: %s",
- parent_loc->path, strerror (op_errno));
+ if (op_ret != 0) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "setattr on parent directory failed: %s",
+ strerror (op_errno));
+ }
loc_wipe (parent_loc);
+ FREE (parent_loc);
+
AFR_STACK_DESTROY (setattr_frame);
return 0;
}
@@ -1126,8 +1130,8 @@ afr_sh_entry_impunge_newfile_cbk (call_frame_t *impunge_frame, void *cookie,
afr_self_heal_t *sh = NULL;
call_frame_t *setattr_frame = NULL;
- loc_t parent_loc;
int32_t valid = 0;
+ loc_t *parent_loc = NULL;
struct stat parentbuf;
priv = this->private;
@@ -1169,7 +1173,8 @@ afr_sh_entry_impunge_newfile_cbk (call_frame_t *impunge_frame, void *cookie,
parentbuf = impunge_sh->parentbuf;
setattr_frame = copy_frame (impunge_frame);
- afr_build_parent_loc (&parent_loc, &impunge_local->loc);
+ parent_loc = CALLOC (1, sizeof (*parent_loc));
+ afr_build_parent_loc (parent_loc, &impunge_local->loc);
STACK_WIND_COOKIE (impunge_frame, afr_sh_entry_impunge_xattrop_cbk,
(void *) (long) child_index,
@@ -1178,10 +1183,10 @@ afr_sh_entry_impunge_newfile_cbk (call_frame_t *impunge_frame, void *cookie,
&impunge_local->loc, GF_XATTROP_ADD_ARRAY, xattr);
STACK_WIND_COOKIE (setattr_frame, afr_sh_entry_impunge_parent_setattr_cbk,
- (void *) (long) &parent_loc,
+ (void *) (long) parent_loc,
priv->children[child_index],
priv->children[child_index]->fops->setattr,
- &parent_loc, &parentbuf, valid);
+ parent_loc, &parentbuf, valid);
dict_unref (xattr);