summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-selfheal.c
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2016-04-25 16:02:10 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-05-02 02:17:06 -0700
commit78c1c6002f0b11afa997a14f8378c04f257ea1c5 (patch)
treebabe31fb2119084da0a6bbed2e6b83f41c17b1af /xlators/cluster/dht/src/dht-selfheal.c
parent232b10d68f47eee4c58f0d44891e52026b98d288 (diff)
cluster/dht: Handle rmdir failure correctly
DHT did not handle rmdir failures on non-hashed subvols correctly in a 2x2 dist-rep volume, causing the directory do be deleted from the hashed subvol. Also fixed an issue where the dht_selfheal_restore errcodes were overwriting the rmdir error codes. Change-Id: If2c6f8dc8ee72e3e6a7e04a04c2108243faca468 BUG: 1330032 Signed-off-by: N Balachandran <nbalacha@redhat.com> Reviewed-on: http://review.gluster.org/14060 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-selfheal.c')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index bb48eb49c38..3e10ef7e344 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -1309,20 +1309,29 @@ dht_selfheal_dir_mkdir_lookup_cbk (call_frame_t *frame, void *cookie,
int missing_dirs = 0;
dht_layout_t *layout = NULL;
loc_t *loc = NULL;
+ call_frame_t *prev = NULL;
VALIDATE_OR_GOTO (this->private, err);
local = frame->local;
layout = local->layout;
loc = &local->loc;
+ prev = cookie;
this_call_cnt = dht_frame_return (frame);
LOCK (&frame->lock);
{
- if ((op_ret < 0) && (op_errno == ENOENT || op_errno == ESTALE))
+ if ((op_ret < 0) &&
+ (op_errno == ENOENT || op_errno == ESTALE)) {
local->selfheal.hole_cnt = !local->selfheal.hole_cnt ? 1
: local->selfheal.hole_cnt + 1;
+ }
+
+ if (!op_ret) {
+ dht_iatt_merge (this, &local->stbuf, stbuf, prev->this);
+ }
+
}
UNLOCK (&frame->lock);