From 3d03c4bf9b46fcbb26bdc1e06fb96099c1894871 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Mon, 30 Jun 2014 07:20:46 +0000 Subject: glusterd/geo-rep: Check if the state file is present or not. Currently every geo-rep operation other than start and stop force, checks if the state-file is present or not before performing the operation. This check is done to confirm that the session on which the op is being performed is created. This patch makes the start command also perform the same check and accordingly display the correct error. Change-Id: Ifd8bdfa3f362e91f58ead3202e2ebdbd411080e5 BUG: 1114469 Signed-off-by: Avra Sengupta Reviewed-on: http://review.gluster.org/8202 Tested-by: Gluster Build System Reviewed-by: Kotresh HR Reviewed-by: Aravinda VK Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index 58948b98584..a190e1c8aea 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -2586,11 +2586,7 @@ glusterd_op_stage_gsync_set (dict_t *dict, char **op_errstr) /* Allowing stop force to bypass the statefile check * as this command acts as a fail safe method to stop geo-rep * session. */ - if ((type == GF_GSYNC_OPTION_TYPE_CONFIG) || - ((type == GF_GSYNC_OPTION_TYPE_STOP) && !is_force) || - (type == GF_GSYNC_OPTION_TYPE_DELETE) || - (type == GF_GSYNC_OPTION_TYPE_PAUSE) || - (type == GF_GSYNC_OPTION_TYPE_RESUME)) { + if (!((type == GF_GSYNC_OPTION_TYPE_STOP) && is_force)) { ret = lstat (statefile, &stbuf); if (ret) { snprintf (errmsg, sizeof(errmsg), "Geo-replication" -- cgit