233933
From 21f376939f03f91214218c485e7d3a2848dae4b2 Mon Sep 17 00:00:00 2001
233933
From: Mohammed Rafi KC <rkavunga@redhat.com>
233933
Date: Thu, 11 Jul 2019 12:43:44 +0530
233933
Subject: [PATCH 231/255] Revert "graph/shd: Use top down approach while
233933
 cleaning xlator"
233933
233933
This reverts commit b963fa8bb71963127147d33bf609f439dd5bd107.
233933
233933
Label : DOWNSTREAM ONLY
233933
233933
BUG: 1471742
233933
Change-Id: Ifb8056395c5988cf7c484891bea052f5415bf9da
233933
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
233933
Reviewed-on: https://code.engineering.redhat.com/gerrit/175941
233933
Tested-by: RHGS Build Bot <nigelb@redhat.com>
233933
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
233933
---
233933
 libglusterfs/src/graph.c                         | 10 +---------
233933
 xlators/features/bit-rot/src/stub/bit-rot-stub.c |  1 -
233933
 xlators/features/changelog/src/changelog.c       |  1 -
233933
 xlators/features/cloudsync/src/cloudsync.c       |  4 +---
233933
 xlators/features/index/src/index.c               |  1 -
233933
 xlators/features/quiesce/src/quiesce.c           |  1 -
233933
 xlators/features/read-only/src/worm.c            |  1 -
233933
 xlators/features/sdfs/src/sdfs.c                 |  1 -
233933
 xlators/features/selinux/src/selinux.c           |  2 --
233933
 xlators/features/trash/src/trash.c               |  1 -
233933
 10 files changed, 2 insertions(+), 21 deletions(-)
233933
233933
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
233933
index 172dc61..5b95fd6 100644
233933
--- a/libglusterfs/src/graph.c
233933
+++ b/libglusterfs/src/graph.c
233933
@@ -1193,14 +1193,6 @@ glusterfs_graph_fini(glusterfs_graph_t *graph)
233933
         if (trav->init_succeeded) {
233933
             trav->cleanup_starting = 1;
233933
             trav->fini(trav);
233933
-            if (trav->local_pool) {
233933
-                mem_pool_destroy(trav->local_pool);
233933
-                trav->local_pool = NULL;
233933
-            }
233933
-            if (trav->itable) {
233933
-                inode_table_destroy(trav->itable);
233933
-                trav->itable = NULL;
233933
-            }
233933
             trav->init_succeeded = 0;
233933
         }
233933
         trav = trav->next;
233933
@@ -1402,7 +1394,7 @@ glusterfs_graph_cleanup(void *arg)
233933
 
233933
     pthread_mutex_lock(&ctx->cleanup_lock);
233933
     {
233933
-        glusterfs_graph_fini(graph);
233933
+        glusterfs_graph_deactivate(graph);
233933
         glusterfs_graph_destroy(graph);
233933
     }
233933
     pthread_mutex_unlock(&ctx->cleanup_lock);
233933
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-stub.c b/xlators/features/bit-rot/src/stub/bit-rot-stub.c
233933
index 03446be..3f48a4b 100644
233933
--- a/xlators/features/bit-rot/src/stub/bit-rot-stub.c
233933
+++ b/xlators/features/bit-rot/src/stub/bit-rot-stub.c
233933
@@ -185,7 +185,6 @@ cleanup_lock:
233933
     pthread_mutex_destroy(&priv->lock);
233933
 free_mempool:
233933
     mem_pool_destroy(priv->local_pool);
233933
-    priv->local_pool = NULL;
233933
 free_priv:
233933
     GF_FREE(priv);
233933
     this->private = NULL;
233933
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
233933
index 2862d1e..d9025f3 100644
233933
--- a/xlators/features/changelog/src/changelog.c
233933
+++ b/xlators/features/changelog/src/changelog.c
233933
@@ -2790,7 +2790,6 @@ cleanup_options:
233933
     changelog_freeup_options(this, priv);
233933
 cleanup_mempool:
233933
     mem_pool_destroy(this->local_pool);
233933
-    this->local_pool = NULL;
233933
 cleanup_priv:
233933
     GF_FREE(priv);
233933
 error_return:
233933
diff --git a/xlators/features/cloudsync/src/cloudsync.c b/xlators/features/cloudsync/src/cloudsync.c
233933
index 0ad987e..26e512c 100644
233933
--- a/xlators/features/cloudsync/src/cloudsync.c
233933
+++ b/xlators/features/cloudsync/src/cloudsync.c
233933
@@ -200,10 +200,8 @@ cs_init(xlator_t *this)
233933
 
233933
 out:
233933
     if (ret == -1) {
233933
-        if (this->local_pool) {
233933
+        if (this->local_pool)
233933
             mem_pool_destroy(this->local_pool);
233933
-            this->local_pool = NULL;
233933
-        }
233933
 
233933
         cs_cleanup_private(priv);
233933
 
233933
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c
233933
index 4ece7ff..2f2a6d0 100644
233933
--- a/xlators/features/index/src/index.c
233933
+++ b/xlators/features/index/src/index.c
233933
@@ -2478,7 +2478,6 @@ out:
233933
             GF_FREE(priv);
233933
         this->private = NULL;
233933
         mem_pool_destroy(this->local_pool);
233933
-        this->local_pool = NULL;
233933
     }
233933
 
233933
     if (attr_inited)
233933
diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c
233933
index 06f58c9..bfd1116 100644
233933
--- a/xlators/features/quiesce/src/quiesce.c
233933
+++ b/xlators/features/quiesce/src/quiesce.c
233933
@@ -2536,7 +2536,6 @@ fini(xlator_t *this)
233933
     this->private = NULL;
233933
 
233933
     mem_pool_destroy(priv->local_pool);
233933
-    priv->local_pool = NULL;
233933
     LOCK_DESTROY(&priv->lock);
233933
     GF_FREE(priv);
233933
 out:
233933
diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c
233933
index 7d13180..24196f8 100644
233933
--- a/xlators/features/read-only/src/worm.c
233933
+++ b/xlators/features/read-only/src/worm.c
233933
@@ -569,7 +569,6 @@ fini(xlator_t *this)
233933
     mem_put(priv);
233933
     this->private = NULL;
233933
     mem_pool_destroy(this->local_pool);
233933
-    this->local_pool = NULL;
233933
 out:
233933
     return;
233933
 }
233933
diff --git a/xlators/features/sdfs/src/sdfs.c b/xlators/features/sdfs/src/sdfs.c
233933
index 164c632..f0247fd 100644
233933
--- a/xlators/features/sdfs/src/sdfs.c
233933
+++ b/xlators/features/sdfs/src/sdfs.c
233933
@@ -1429,7 +1429,6 @@ void
233933
 fini(xlator_t *this)
233933
 {
233933
     mem_pool_destroy(this->local_pool);
233933
-    this->local_pool = NULL;
233933
     return;
233933
 }
233933
 
233933
diff --git a/xlators/features/selinux/src/selinux.c b/xlators/features/selinux/src/selinux.c
233933
index ce5fc90..58b4c5d 100644
233933
--- a/xlators/features/selinux/src/selinux.c
233933
+++ b/xlators/features/selinux/src/selinux.c
233933
@@ -256,7 +256,6 @@ out:
233933
             GF_FREE(priv);
233933
         }
233933
         mem_pool_destroy(this->local_pool);
233933
-        this->local_pool = NULL;
233933
     }
233933
     return ret;
233933
 }
233933
@@ -285,7 +284,6 @@ fini(xlator_t *this)
233933
     GF_FREE(priv);
233933
 
233933
     mem_pool_destroy(this->local_pool);
233933
-    this->local_pool = NULL;
233933
 
233933
     return;
233933
 }
233933
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c
233933
index eb5007b..d668436 100644
233933
--- a/xlators/features/trash/src/trash.c
233933
+++ b/xlators/features/trash/src/trash.c
233933
@@ -2523,7 +2523,6 @@ out:
233933
             GF_FREE(priv);
233933
         }
233933
         mem_pool_destroy(this->local_pool);
233933
-        this->local_pool = NULL;
233933
     }
233933
     return ret;
233933
 }
233933
-- 
233933
1.8.3.1
233933