summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-09-02 03:08:55 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-02 05:56:58 -0700
commit0d1199ecf08cb513db7bcd26db672811207fe5cf (patch)
tree9cb9559f715b9f13801f333886ad63e81830e1b7 /xlators/cluster/dht/src
parenta2b9b121d2670014fce07e0e3bdc311c587c0f2f (diff)
cluster/dht: check for op_ret in dht_selfheal_dir_mkdir_cbk ()
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1503 (segfault in distribute during failover testing) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1503
Diffstat (limited to 'xlators/cluster/dht/src')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index 00424f27d..f3504935d 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -211,14 +211,7 @@ dht_selfheal_dir_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
prev = cookie;
subvol = prev->this;
- dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
- if (prev->this == local->hashed_subvol)
- local->ia_ino = local->stbuf.ia_ino;
-
- dht_iatt_merge (this, &local->preparent, preparent, prev->this);
- dht_iatt_merge (this, &local->postparent, postparent, prev->this);
-
- if ((op_ret == 0) || (op_errno == EEXIST)) {
+ if ((op_ret == 0) || ((op_ret == -1) && (op_errno == EEXIST))) {
for (i = 0; i < layout->cnt; i++) {
if (layout->list[i].xlator == subvol) {
layout->list[i].err = -1;
@@ -227,6 +220,18 @@ dht_selfheal_dir_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
}
+ if (op_ret)
+ goto out;
+
+
+ dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
+ if (prev->this == local->hashed_subvol)
+ local->ia_ino = local->stbuf.ia_ino;
+
+ dht_iatt_merge (this, &local->preparent, preparent, prev->this);
+ dht_iatt_merge (this, &local->postparent, postparent, prev->this);
+
+out:
this_call_cnt = dht_frame_return (frame);
if (is_last_call (this_call_cnt)) {