diff options
author | N Balachandran <nbalacha@redhat.com> | 2016-06-17 13:03:14 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2016-06-18 22:48:44 -0700 |
commit | 89b5867fc7dc20ccb3af512d2723b1021d852381 (patch) | |
tree | 014eb68f6d1a7762dc0fbbd6cf5c0eb52f62fc3b /xlators/cluster/dht/src/dht-selfheal.c | |
parent | ae47d5b55e5c5f32a45bd9d1dd741a1c072ab2d6 (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>
(cherry picked from commit 78c1c6002f0b11afa997a14f8378c04f257ea1c5)
Change-Id: Id3f7c8fd515586d09f1f29c2eceddfee2ef8ec55
BUG: 1347529
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: http://review.gluster.org/14751
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
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.c | 11 |
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 3da1279b8db..a8c0ba7bc4d 100644 --- a/xlators/cluster/dht/src/dht-selfheal.c +++ b/xlators/cluster/dht/src/dht-selfheal.c @@ -1310,20 +1310,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); |