summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht
diff options
context:
space:
mode:
authorRaghavendra G <rgowdapp@redhat.com>2014-06-21 19:20:46 +0530
committerVijay Bellur <vbellur@redhat.com>2014-06-23 05:55:30 -0700
commit83fa1cfe185f05319a0048a63c8c163e4e632cf7 (patch)
treef016f6f0a60ae9b6c90fc6c96d9dab8dff5b573f /xlators/cluster/dht
parent6ddb67c8f53bdfc5fb0ca2427b6f1a0112c49ecc (diff)
cluster/dht: handle ESTALE appropriately in rmdir codepath.
Till we separated the scenario of a file/directory not existing from parent not existing [1], we used to include a subvolume in the layout of a directory even if it is not present on that subvolume. This was done to allow a lookup racing with mkdir to create correct layout. However, there are other scenarios as well where a directory is not present. One such situation is trying to create a directory after an add-brick. Since there is no guarantee that all the ancestors are created after an add-brick (and hence directory cannot be created), the newly added brick should not be part of the layout. However, we used to consider newly added brick as part of layout (even before we do fix-layout of all the ancestors) and this was the root cause of [2]. With [1], this issue got fixed and hence [2] got fixed too. However, [1] is not complete in the sense we didn't modify rmdir codepath appropriately. This patch fixes that gap. [1] http://review.gluster.org/6322 [2] https://bugzilla.redhat.com/show_bug.cgi?id=1006809 Change-Id: I79ab96bb8abb6f3d90bb6e235a1c465e1be0fd19 BUG: 1032894 Signed-off-by: Raghavendra G <rgowdapp@redhat.com> Reviewed-on: http://review.gluster.org/8142 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/dht')
-rw-r--r--xlators/cluster/dht/src/dht-common.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 72ec641cce1..6360344992c 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -4594,12 +4594,14 @@ dht_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
LOCK (&frame->lock);
{
if (op_ret == -1) {
- local->op_errno = op_errno;
- local->op_ret = -1;
+ if ((op_errno != ENOENT) && (op_errno != ESTALE)) {
+ local->op_errno = op_errno;
+ local->op_ret = -1;
- if (op_errno != ENOENT && op_errno != EACCES) {
- local->need_selfheal = 1;
+ if (op_errno != EACCES)
+ local->need_selfheal = 1;
}
+
uuid_unparse(local->loc.gfid, gfid);
gf_msg_debug (this->name, 0,
@@ -5104,7 +5106,7 @@ dht_rmdir_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
"gfid = %s, (%s)",
prev->this->name, local->loc.path, gfid,
strerror (op_errno));
- if (op_errno != ENOENT) {
+ if ((op_errno != ENOENT) && (op_errno != ESTALE)) {
local->op_ret = -1;
local->op_errno = op_errno;
}