summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2019-06-27 19:17:29 +0530
committerRinku Kothiya <rkothiya@redhat.com>2019-07-24 10:26:34 +0000
commit3c3b6377d6bdea9bffec31da88dd629347617b6d (patch)
treea888db22f975772af2c2986dda4a81c43f28aea6 /libglusterfs
parentb2531751a186e31d8c0ca3f7e3e44475294931b6 (diff)
graph/shd: Use top down approach while cleaning xlator
We were cleaning xlator from botton to top, which might lead to problems when upper xlators trying to access the xlator object loaded below. One such scenario is when fd_unref happens as part of the fini call which might lead to calling the releasedir to lower xlator. This will lead to invalid mem access Backport of:https://review.gluster.org/#/c/glusterfs/+/22968/ >Change-Id: I8a6cb619256fab0b0c01a2d564fc88287c4415a0 >Updates: bz#1716695 >Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Change-Id: I8a6cb619256fab0b0c01a2d564fc88287c4415a0 Updates: bz#1730229 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/graph.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
index aea74a5edad..0b99e618191 100644
--- a/libglusterfs/src/graph.c
+++ b/libglusterfs/src/graph.c
@@ -1200,6 +1200,14 @@ glusterfs_graph_fini(glusterfs_graph_t *graph)
if (trav->init_succeeded) {
trav->cleanup_starting = 1;
trav->fini(trav);
+ if (trav->local_pool) {
+ mem_pool_destroy(trav->local_pool);
+ trav->local_pool = NULL;
+ }
+ if (trav->itable) {
+ inode_table_destroy(trav->itable);
+ trav->itable = NULL;
+ }
trav->init_succeeded = 0;
}
trav = trav->next;
@@ -1401,7 +1409,7 @@ glusterfs_graph_cleanup(void *arg)
pthread_mutex_lock(&ctx->cleanup_lock);
{
- glusterfs_graph_deactivate(graph);
+ glusterfs_graph_fini(graph);
glusterfs_graph_destroy(graph);
}
pthread_mutex_unlock(&ctx->cleanup_lock);