summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2012-04-16 14:39:10 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-17 06:26:42 -0700
commitc20f501d0632d6105f0d570ac8dec251974ebe87 (patch)
treebf10bb8a875309f3626e409e5ca725a231b919da /xlators/cluster
parent0049c2405aa39fe4ef299bd646e7a53e40753039 (diff)
cluster/dht: Handle failures in getxattr_cbk
Change-Id: Ifbce2d69f0fdd0c45cba92b6fc2dffe13c60de28 BUG: 810106 Signed-off-by: shishir gowda <shishirng@gluster.com> Reviewed-on: http://review.gluster.com/3156 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-common.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 57bacb88865..c017813d63e 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -1707,10 +1707,12 @@ dht_vgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
dict_t *dict = NULL;
int32_t alloc_len = 0;
int32_t plen = 0;
+ call_frame_t *prev = NULL;
local = frame->local;
+ prev = cookie;
- if (op_ret != -1) {
+ if (op_ret >= 0) {
ret = dict_get_str (xattr, local->xsel, &value_got);
if (!ret) {
alloc_len = strlen (value_got);
@@ -1742,12 +1744,23 @@ dht_vgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
strcat (local->xattr_val, value_got);
}
+ local->op_ret = 0;
}
+ } else {
+ local->op_ret = -1;
+ local->op_errno = op_errno;
+ gf_log (this->name, GF_LOG_ERROR, "Subvolume %s returned -1 "
+ "(%s)", prev->this->name, strerror (op_errno));
}
out:
this_call_cnt = dht_frame_return (frame);
if (is_last_call (this_call_cnt)) {
+
+ if (local->op_ret == -1) {
+ goto unwind;
+ }
+
if (local->layout->cnt > 1) {
/* Set it for directory */
fill_layout_info (local->layout, layout_buf);
@@ -1806,8 +1819,8 @@ dht_vgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
gf_log ("this->name", GF_LOG_ERROR, "Unable to find hashed_subvol"
" for path %s", local->xattr_val);
-
- DHT_STACK_UNWIND (getxattr, frame, -1, op_errno, dict, xdata);
+unwind:
+ DHT_STACK_UNWIND (getxattr, frame, -1, local->op_errno, NULL, NULL);
return 0;
}