summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.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-common.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-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 57d069ddc..5ea7bcc2f 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1243,10 +1243,12 @@ afr_sh_missing_entries_lookup_done (call_frame_t *frame, xlator_t *this,
afr_private_t *priv = NULL;
ia_type_t ia_type = IA_INVAL;
int32_t nsources = 0;
+ loc_t *loc = NULL;
local = frame->local;
sh = &local->self_heal;
priv = this->private;
+ loc = &local->loc;
if (op_ret < 0) {
if (op_errno == EIO)
@@ -1281,6 +1283,8 @@ afr_sh_missing_entries_lookup_done (call_frame_t *frame, xlator_t *this,
if (sh->gfid_sh_success_cbk)
sh->gfid_sh_success_cbk (frame, this);
sh->type = sh->buf[sh->source].ia_type;
+ if (uuid_is_null (loc->inode->gfid))
+ uuid_copy (loc->gfid, sh->buf[sh->source].ia_gfid);
sh_missing_entries_create (frame, this);
return;
out:
@@ -1846,6 +1850,7 @@ afr_sh_post_nb_entrylk_conflicting_sh_cbk (call_frame_t *frame, xlator_t *this)
if (int_lock->lock_op_ret < 0) {
gf_log (this->name, GF_LOG_INFO,
"Non blocking entrylks failed.");
+ sh->op_failed = -1;
afr_sh_missing_entries_done (frame, this);
} else {
@@ -2084,9 +2089,9 @@ afr_self_heal (call_frame_t *frame, xlator_t *this, inode_t *inode)
int32_t op_errno = 0;
int ret = 0;
afr_self_heal_t *orig_sh = NULL;
-
- call_frame_t *sh_frame = NULL;
- afr_local_t *sh_local = NULL;
+ call_frame_t *sh_frame = NULL;
+ afr_local_t *sh_local = NULL;
+ loc_t *loc = NULL;
local = frame->local;
orig_sh = &local->self_heal;
@@ -2189,6 +2194,13 @@ afr_self_heal (call_frame_t *frame, xlator_t *this, inode_t *inode)
GF_ASSERT (!uuid_is_null (sh->sh_gfid_req));
afr_self_heal_gfids (sh_frame, this);
} else {
+ loc = &sh_local->loc;
+ if (uuid_is_null (loc->inode->gfid) && uuid_is_null (loc->gfid)) {
+ if (!uuid_is_null (inode->gfid))
+ GF_ASSERT (!uuid_compare (inode->gfid,
+ sh->sh_gfid_req));
+ uuid_copy (loc->gfid, sh->sh_gfid_req);
+ }
gf_log (this->name, GF_LOG_TRACE,
"proceeding to metadata check on %s",
local->loc.path);
@@ -2256,7 +2268,7 @@ afr_self_heal_type_for_transaction (afr_transaction_type type)
}
int
-afr_build_child_loc (xlator_t *this, loc_t *child, loc_t *parent, char *name)
+afr_build_child_loc (xlator_t *this, loc_t *child, loc_t *parent, char *name, uuid_t gfid)
{
int ret = -1;
@@ -2290,6 +2302,7 @@ afr_build_child_loc (xlator_t *this, loc_t *child, loc_t *parent, char *name)
ret = -1;
goto out;
}
+ uuid_copy (child->gfid, gfid);
ret = 0;
out: