d1681e
From aea891fe38aa75329b84952db2a8aad0e5536cea Mon Sep 17 00:00:00 2001
d1681e
From: Mohit Agrawal <moagrawal@redhat.com>
d1681e
Date: Wed, 8 Aug 2018 08:17:28 +0530
d1681e
Subject: [PATCH 343/351] core: Update condition in get_xlator_by_name_or_type
d1681e
d1681e
Problem: Sometimes client connection is failed after throwing
d1681e
         error "cleanup flag is set for xlator Try again later".
d1681e
         The situation comes only after get a detach request but
d1681e
         the brick stack is not completely detached and at the same time
d1681e
         the client initiates a connection with brick
d1681e
d1681e
Solution: To resolve the same check cleanup_starting flag in get
d1681e
          xlator_by_name_or_type, this function call by server_setvolume
d1681e
          to attach a client with brick.
d1681e
d1681e
> Change-Id: I3720e42642fe495dd05211e2ed2cb976db9e231b
d1681e
> fixes: bz#1614124
d1681e
> (cherry pick from commit a6900e829484435c5bd5d8efe38490cab54ac442)
d1681e
> (Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/20657/)
d1681e
d1681e
Change-Id: Id51823148b519f42f762ef716a6434eb2b5f2ffc
d1681e
BUG: 1608352
d1681e
Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
d1681e
Reviewed-on: https://code.engineering.redhat.com/gerrit/146848
d1681e
Tested-by: Mohit Agrawal <moagrawa@redhat.com>
d1681e
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
d1681e
---
d1681e
 libglusterfs/src/xlator.c | 2 +-
d1681e
 1 file changed, 1 insertion(+), 1 deletion(-)
d1681e
d1681e
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
d1681e
index 4722800..1cf4a63 100644
d1681e
--- a/libglusterfs/src/xlator.c
d1681e
+++ b/libglusterfs/src/xlator.c
d1681e
@@ -424,7 +424,7 @@ get_xlator_by_name_or_type (xlator_t *this, char *target, int is_name)
d1681e
 
d1681e
         for (trav = this->children; trav; trav = trav->next) {
d1681e
                 value = is_name ? trav->xlator->name : trav->xlator->type;
d1681e
-                if (!strcmp(value, target)) {
d1681e
+                if (!strcmp(value, target) && !trav->xlator->cleanup_starting) {
d1681e
                         return trav->xlator;
d1681e
                 }
d1681e
                 child_xl = get_xlator_by_name_or_type (trav->xlator, target,
d1681e
-- 
d1681e
1.8.3.1
d1681e