summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-10-22 06:36:22 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-10-22 06:05:13 -0700
commit8c86febc41816730c9fd44fd87cefe3ef330d072 (patch)
treec697bfa0ddb4f7ace7ae1d96d583369c1e098cc3 /xlators/cluster
parentd5009323b3031122508fbd8daa61025b7c397e3c (diff)
cluster/afr: entry self-heal: Store parent_loc on the heap for impunge_parent_setattr.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 137 (Parent directory mtime not reset after a create in self-heal) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=137
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);