e3c68b
From 1864a4f382f3031915e8126440a1561035487e49 Mon Sep 17 00:00:00 2001
e3c68b
From: Mohammed Rafi KC <rkavunga@redhat.com>
e3c68b
Date: Thu, 11 Jul 2019 12:53:20 +0530
e3c68b
Subject: [PATCH 249/255] Revert "client/fini: return fini after rpc cleanup"
e3c68b
e3c68b
This reverts commit d79cb2cdff6fe8d962c9ac095a7541ddf500302b.
e3c68b
e3c68b
BUG: 1471742
e3c68b
Change-Id: I15e6544d47fb7b6002c3b44de3fe0b2a13c84f51
e3c68b
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
e3c68b
Reviewed-on: https://code.engineering.redhat.com/gerrit/175958
e3c68b
Tested-by: RHGS Build Bot <nigelb@redhat.com>
e3c68b
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
e3c68b
---
e3c68b
 xlators/protocol/client/src/client.c | 25 +++++--------------------
e3c68b
 xlators/protocol/client/src/client.h |  6 ------
e3c68b
 2 files changed, 5 insertions(+), 26 deletions(-)
e3c68b
e3c68b
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
e3c68b
index 95e4be5..532ef35 100644
e3c68b
--- a/xlators/protocol/client/src/client.c
e3c68b
+++ b/xlators/protocol/client/src/client.c
e3c68b
@@ -49,12 +49,11 @@ client_fini_complete(xlator_t *this)
e3c68b
     if (!conf->destroy)
e3c68b
         return 0;
e3c68b
 
e3c68b
-    pthread_mutex_lock(&conf->lock);
e3c68b
-    {
e3c68b
-        conf->fini_completed = _gf_true;
e3c68b
-        pthread_cond_broadcast(&conf->fini_complete_cond);
e3c68b
-    }
e3c68b
-    pthread_mutex_unlock(&conf->lock);
e3c68b
+    this->private = NULL;
e3c68b
+
e3c68b
+    pthread_spin_destroy(&conf->fd_lock);
e3c68b
+    pthread_mutex_destroy(&conf->lock);
e3c68b
+    GF_FREE(conf);
e3c68b
 
e3c68b
 out:
e3c68b
     return 0;
e3c68b
@@ -2730,7 +2729,6 @@ init(xlator_t *this)
e3c68b
         goto out;
e3c68b
 
e3c68b
     pthread_mutex_init(&conf->lock, NULL);
e3c68b
-    pthread_cond_init(&conf->fini_complete_cond, NULL);
e3c68b
     pthread_spin_init(&conf->fd_lock, 0);
e3c68b
     INIT_LIST_HEAD(&conf->saved_fds);
e3c68b
 
e3c68b
@@ -2789,7 +2787,6 @@ fini(xlator_t *this)
e3c68b
     if (!conf)
e3c68b
         return;
e3c68b
 
e3c68b
-    conf->fini_completed = _gf_false;
e3c68b
     conf->destroy = 1;
e3c68b
     if (conf->rpc) {
e3c68b
         /* cleanup the saved-frames before last unref */
e3c68b
@@ -2797,18 +2794,6 @@ fini(xlator_t *this)
e3c68b
         rpc_clnt_unref(conf->rpc);
e3c68b
     }
e3c68b
 
e3c68b
-    pthread_mutex_lock(&conf->lock);
e3c68b
-    {
e3c68b
-        while (!conf->fini_completed)
e3c68b
-            pthread_cond_wait(&conf->fini_complete_cond, &conf->lock);
e3c68b
-    }
e3c68b
-    pthread_mutex_unlock(&conf->lock);
e3c68b
-
e3c68b
-    pthread_spin_destroy(&conf->fd_lock);
e3c68b
-    pthread_mutex_destroy(&conf->lock);
e3c68b
-    pthread_cond_destroy(&conf->fini_complete_cond);
e3c68b
-    GF_FREE(conf);
e3c68b
-
e3c68b
     /* Saved Fds */
e3c68b
     /* TODO: */
e3c68b
 
e3c68b
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
e3c68b
index 8dcd72f..f12fa61 100644
e3c68b
--- a/xlators/protocol/client/src/client.h
e3c68b
+++ b/xlators/protocol/client/src/client.h
e3c68b
@@ -235,12 +235,6 @@ typedef struct clnt_conf {
e3c68b
                                       * up, disconnects can be
e3c68b
                                       * logged
e3c68b
                                       */
e3c68b
-
e3c68b
-    gf_boolean_t old_protocol;         /* used only for old-protocol testing */
e3c68b
-    pthread_cond_t fini_complete_cond; /* Used to wait till we finsh the fini
e3c68b
-                                          compltely, ie client_fini_complete
e3c68b
-                                          to return*/
e3c68b
-    gf_boolean_t fini_completed;
e3c68b
 } clnt_conf_t;
e3c68b
 
e3c68b
 typedef struct _client_fd_ctx {
e3c68b
-- 
e3c68b
1.8.3.1
e3c68b