summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-bitrot.c
diff options
context:
space:
mode:
authorGaurav Kumar Garg <ggarg@redhat.com>2015-04-15 11:37:22 +0530
committerKaushal M <kaushal@redhat.com>2015-05-06 00:22:35 -0700
commitc054b729f7bfdb25507602c510671ec79eca8752 (patch)
tree6e0183b274e2b1eccf994ffd97861f9abfe7bf84 /xlators/mgmt/glusterd/src/glusterd-bitrot.c
parent94e5f4bf6555fd102dcc15e3b91685d7728cd064 (diff)
glusterd: do not pass volinfo in glusterd_svc_manager function
On restarting of glusterd first it will start all the bricks present in the volume then it will start all the services. During starting of all the services it may pass volinfo as a NULL. It will cause Assert failure in glusterd_bitdsvc_manager function and will cause a glusterd crash. Change-Id: Ia14cf5022da88516cdd576eb2d1e0e7b17a3782b BUG: 1218039 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/10241 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com> (cherry picked from commit 7648c0de36c7927b588abc66734c5b94afb08c00) Reviewed-on: http://review.gluster.org/10481 Tested-by: NetBSD Build System Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-bitrot.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-bitrot.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-bitrot.c b/xlators/mgmt/glusterd/src/glusterd-bitrot.c
index 55a5e3ac750..ae654a0aa87 100644
--- a/xlators/mgmt/glusterd/src/glusterd-bitrot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-bitrot.c
@@ -312,11 +312,16 @@ out:
}
gf_boolean_t
-glusterd_all_volumes_with_bitrot_stopped ()
+glusterd_should_i_stop_bitd ()
{
- glusterd_conf_t *conf = THIS->private;
- glusterd_volinfo_t *volinfo = NULL;
- gf_boolean_t stopped = _gf_true;
+ glusterd_conf_t *conf = THIS->private;
+ glusterd_volinfo_t *volinfo = NULL;
+ gf_boolean_t stopped = _gf_true;
+ glusterd_brickinfo_t *brickinfo = NULL;
+ xlator_t *this = NULL;
+
+ this = THIS;
+ GF_ASSERT (this);
cds_list_for_each_entry (volinfo, &conf->volumes, vol_list) {
if (!glusterd_is_bitrot_enabled (volinfo))
@@ -324,7 +329,15 @@ glusterd_all_volumes_with_bitrot_stopped ()
else if (volinfo->status != GLUSTERD_STATUS_STARTED)
continue;
else {
- stopped = _gf_false;
+ cds_list_for_each_entry (brickinfo, &volinfo->bricks,
+ brick_list) {
+ if (!glusterd_is_local_brick (this, volinfo,
+ brickinfo))
+ continue;
+ stopped = _gf_false;
+ break;
+ }
+
break;
}
}
@@ -333,7 +346,7 @@ glusterd_all_volumes_with_bitrot_stopped ()
}
static int
-glusterd_manage_bitrot (int opcode, glusterd_volinfo_t *volinfo)
+glusterd_manage_bitrot (int opcode)
{
int ret = -1;
xlator_t *this = NULL;
@@ -349,7 +362,7 @@ glusterd_manage_bitrot (int opcode, glusterd_volinfo_t *volinfo)
case GF_BITROT_OPTION_TYPE_ENABLE:
case GF_BITROT_OPTION_TYPE_DISABLE:
ret = priv->bitd_svc.manager (&(priv->bitd_svc),
- volinfo, PROC_START_NO_WAIT);
+ NULL, PROC_START_NO_WAIT);
if (ret)
break;
ret = priv->scrub_svc.manager (&(priv->scrub_svc), NULL,
@@ -445,7 +458,7 @@ glusterd_op_bitrot (dict_t *dict, char **op_errstr, dict_t *rsp_dict)
goto out;
}
- ret = glusterd_manage_bitrot (type, volinfo);
+ ret = glusterd_manage_bitrot (type);
if (ret)
goto out;