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