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