summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2011-11-05 14:54:28 +0530
committerVijay Bellur <vijay@gluster.com>2011-11-05 05:56:28 -0700
commit51601b2bffea08f3b7fddf901e204b1bc649ab15 (patch)
tree98ba89b5e2dca75d086f302caf0fdcaad5f9b6b3
parent8668da9744df57f7b8929e4b54842a99899a63c5 (diff)
cluster/afr: Handle absence of gfid in lookupv3.2.5qa6
Change-Id: I57fe8db82425a064ca01b23a47baca297c67560c BUG: 3783 Reviewed-on: http://review.gluster.com/676 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/cluster/afr/src/afr-common.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index ba451a0e89a..3a015a7f725 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -198,8 +198,8 @@ afr_lookup_save_gfid (uuid_t dst, void* new, const loc_t *loc)
} else if (!uuid_is_null (loc->gfid)) {
uuid_copy (dst, loc->gfid);
} else {
- GF_ASSERT (new && !uuid_is_null (new));
- uuid_copy (dst, new);
+ if (new && !uuid_is_null (new))
+ uuid_copy (dst, new);
}
}
@@ -1385,6 +1385,7 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this)
afr_local_t *local = NULL;
int ret = -1;
gf_boolean_t sh_launched = _gf_false;
+ gf_boolean_t fail_conflict = _gf_false;
int gfid_miss_count = 0;
int enotconn_count = 0;
int up_children_count = 0;
@@ -1408,7 +1409,18 @@ afr_lookup_done (call_frame_t *frame, xlator_t *this)
goto unwind;
}
- ret = afr_lookup_done_success_action (frame, this, _gf_false);
+ if ((gfid_miss_count == local->success_count) &&
+ uuid_is_null (local->cont.lookup.gfid_req)) {
+ local->op_ret = -1;
+ local->op_errno = ENODATA;
+ gf_log (this->name, GF_LOG_ERROR, "%s: No gfid present",
+ local->loc.path);
+ goto unwind;
+ }
+
+ if (gfid_miss_count && uuid_is_null (local->cont.lookup.gfid_req))
+ fail_conflict = _gf_true;
+ ret = afr_lookup_done_success_action (frame, this, fail_conflict);
if (ret)
goto unwind;
uuid_copy (local->self_heal.sh_gfid_req, local->cont.lookup.gfid_req);