summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-entry.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-11-04 19:10:11 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-18 04:20:33 -0800
commit3bc27345bf3aaf911960793ef4d48909f585bd84 (patch)
treedb3097cffcbc1bfd8e6732b852081cefe5ff578b /xlators/cluster/afr/src/afr-self-heal-entry.c
parent7e085ebc9ca0d34e6251611fdc42dadc243ce276 (diff)
dht,afr: Fixed gfid problems
*) removed uuid_generate usage in pump and afr, self-heald *) filled the gfids for the fops which were sending no gfid in loc Change-Id: I85da3c10f5ee2006248b0123155a60867870d202 BUG: 3760 Reviewed-on: http://review.gluster.com/679 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index 98ef82fe5..f87de0c1f 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -177,6 +177,11 @@ afr_sh_entry_erase_pending (call_frame_t *frame, xlator_t *this)
sh = &local->self_heal;
priv = this->private;
+ if (sh->entries_skipped) {
+ need_unwind = 1;
+ sh->op_failed = _gf_true;
+ goto out;
+ }
afr_sh_pending_to_delta (priv, sh->xattr, sh->delta_matrix, sh->success,
priv->child_count, AFR_ENTRY_TRANSACTION);
@@ -224,6 +229,7 @@ afr_sh_entry_erase_pending (call_frame_t *frame, xlator_t *this)
}
GF_FREE (erase_xattr);
+out:
if (need_unwind)
afr_sh_entry_finish (frame, this);
@@ -721,7 +727,8 @@ afr_sh_entry_expunge_entry (call_frame_t *frame, xlator_t *this,
expunge_sh->active_source = active_src;
expunge_sh->entrybuf = entry->d_stat;
- ret = afr_build_child_loc (this, &expunge_local->loc, &local->loc, name);
+ ret = afr_build_child_loc (this, &expunge_local->loc, &local->loc,
+ name, entry->d_stat.ia_gfid);
if (ret != 0) {
op_errno = EINVAL;
goto out;
@@ -1706,8 +1713,13 @@ afr_sh_entry_common_lookup_done (call_frame_t *impunge_frame, xlator_t *this,
afr_update_gfid_from_iatts (gfid, impunge_sh->buf,
impunge_sh->success_children,
priv->child_count);
- if (uuid_is_null (gfid))
- uuid_generate (gfid);
+ if (uuid_is_null (gfid)) {
+ sh->entries_skipped = _gf_true;
+ gf_log (this->name, GF_LOG_INFO, "%s: Skipping entry "
+ "self-heal because of gfid absence",
+ impunge_local->loc.path);
+ goto done;
+ }
afr_sh_common_lookup (impunge_frame, this, &impunge_local->loc,
afr_sh_entry_common_lookup_done, gfid,
AFR_LOOKUP_FAIL_CONFLICTS |
@@ -1776,7 +1788,7 @@ afr_sh_entry_impunge_entry (call_frame_t *frame, xlator_t *this,
impunge_local = impunge_frame->local;
ret = afr_build_child_loc (this, &impunge_local->loc, &local->loc,
- entry->d_name);
+ entry->d_name, entry->d_stat.ia_gfid);
if (ret != 0) {
op_errno = ENOMEM;
goto out;