summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2018-10-10 10:31:18 +0530
committerAmar Tumballi <amarts@redhat.com>2018-10-12 15:22:36 +0000
commit7bf95631b52bd05b06122180f8bd4aa62c70b1a9 (patch)
treebce80fea2f576bdeea789a0b2dd83335d69953d7 /libglusterfs/src
parent777412c5e8a1e8613061fef31bd8a60d4cd54b6e (diff)
core: glusterfsd keeping fd open in index xlator
Problem: At the time of processing GF_EVENT_PARENT_DOWN at brick xlator, it forwards the event to next xlator only while xlator ensures no stub is in progress. At io-thread xlator it decreases stub_cnt before the process a stub and notify EVENT to next xlator Solution: Introduce a new counter to save stub_cnt and decrease the counter after process the stub completely at io-thread xlator. To avoid brick crash at the time of call xlator_mem_cleanup move only brick xlator if detach brick name has found in the graph Note: Thanks to pranith for sharing a simple reproducer to reproduce the same fixes bz#1637934 Change-Id: I1a694a001f7a5417e8771e3adf92c518969b6baa Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/xlator.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index 01cb27896ee..b305ad50e5d 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -1051,6 +1051,7 @@ xlator_mem_cleanup(xlator_t *this)
top = ctx->active->first;
LOCK(&ctx->volfile_lock);
/* TODO here we have leak for xlator node in a graph */
+ /* Need to move only top xlator from a graph */
for (trav_p = &top->children; *trav_p; trav_p = &(*trav_p)->next) {
victim = (*trav_p)->xlator;
if (victim->call_cleanup && !strcmp(victim->name, this->name)) {
@@ -1058,19 +1059,6 @@ xlator_mem_cleanup(xlator_t *this)
break;
}
}
- /* TODO Sometime brick xlator is not moved from graph so followed below
- approach to move brick xlator from a graph, will move specific brick
- xlator from graph only while inode table and mem_acct are cleaned up
- */
- trav_p = &top->children;
- while (*trav_p) {
- victim = (*trav_p)->xlator;
- if (victim->call_cleanup && !victim->itable && !victim->mem_acct) {
- (*trav_p) = (*trav_p)->next;
- } else {
- trav_p = &(*trav_p)->next;
- }
- }
UNLOCK(&ctx->volfile_lock);
}
}