summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2017-02-08 10:48:55 -0500
committerShyamsundar Ranganathan <srangana@redhat.com>2017-02-10 06:44:01 -0500
commit5c3f113cd8acc341a62245cea60a2249034091c5 (patch)
tree81ab24e60295ab756d5f969360b79ae39944c17b
parent521ea50161039edf4df589b448a45bb707ae19a2 (diff)
trash: fix problem with trash feature under multiplexing
With multiplexing, the trash translator gets a reconfigure call before a notify(CHILD_UP). In this case, priv->trash_itable was not yet initialized, so the reconfigure would get a SEGV. Moving the itable allocation to init seems to fix it, so trash can be reenabled. Backport of: > Change-Id: I21ac2d7fc66bac1bc4ec70fbc8bae306d73ac565 > BUG: 1420434 > Reviewed-on: https://review.gluster.org/16567 Change-Id: I43a6de6ac5070848619c5f905f075e4a4099c1bd BUG: 1420808 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: https://review.gluster.org/16582 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Anoop C S <anoopcs@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
-rw-r--r--tests/basic/multiplex.t4
-rw-r--r--xlators/features/trash/src/trash.c2
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c6
3 files changed, 4 insertions, 8 deletions
diff --git a/tests/basic/multiplex.t b/tests/basic/multiplex.t
index d503bf5a232..cfac357b2f1 100644
--- a/tests/basic/multiplex.t
+++ b/tests/basic/multiplex.t
@@ -18,10 +18,12 @@ function count_brick_pids {
}
TEST glusterd
-TEST $CLI volume set all cluster.brick-multiplex yes
+TEST $CLI volume set all cluster.brick-multiplex on
push_trapfunc "$CLI volume set all cluster.brick-multiplex off"
push_trapfunc "cleanup"
+
TEST $CLI volume create $V0 $H0:$B0/brick{0,1}
+TEST $CLI volume set $V0 features.trash enable
TEST $CLI volume start $V0
# Without multiplexing, there would be two.
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c
index 3f1b4c5dd1a..e321a05a01b 100644
--- a/xlators/features/trash/src/trash.c
+++ b/xlators/features/trash/src/trash.c
@@ -2375,7 +2375,6 @@ notify (xlator_t *this, int event, void *data, ...)
/* Check whether posix is up not */
if (event == GF_EVENT_CHILD_UP) {
- priv->trash_itable = inode_table_new (0, this);
if (!priv->state) {
gf_log (this->name, GF_LOG_DEBUG, "trash xlator is off");
goto out;
@@ -2547,6 +2546,7 @@ init (xlator_t *this)
goto out;
}
+ priv->trash_itable = inode_table_new (0, this);
gf_log (this->name, GF_LOG_DEBUG, "brick path is%s", priv->brick_path);
this->private = (void *)priv;
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index df68aa52922..a596efa827a 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1517,7 +1517,6 @@ out:
return ret;
}
-#if 0
static int
brick_graph_add_trash (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
dict_t *set_dict, glusterd_brickinfo_t *brickinfo)
@@ -1540,7 +1539,6 @@ brick_graph_add_trash (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
out:
return ret;
}
-#endif
static int
brick_graph_add_decompounder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
@@ -2459,11 +2457,7 @@ static volgen_brick_xlator_t server_graph_table[] = {
{brick_graph_add_changetimerecorder, "changetimerecorder"},
#endif
{brick_graph_add_bd, "bd"},
- /*
- * TBD: Figure out why trash breaks multiplexing. AFAICT it should fail
- * the same way already.
{brick_graph_add_trash, "trash"},
- */
{brick_graph_add_arbiter, "arbiter"},
{brick_graph_add_posix, "posix"},
};