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