summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c5
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c8
2 files changed, 8 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index 594ea124c10..123fdc11655 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -4258,7 +4258,10 @@ glusterd_gsync_read_frm_status (char *path, char *buf, size_t blen)
while (isspace (*p))
*p-- = '\0';
}
- } else if (ret < 0)
+ } else if (ret == 0)
+ gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_GSYNCD_ERROR,
+ "Status file of gsyncd is empty");
+ else /* ret < 0 */
gf_msg (this->name, GF_LOG_ERROR, 0, GD_MSG_GSYNCD_ERROR,
"Status file of gsyncd is corrupt");
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index b9145b58408..1f3c1a471a4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -4975,7 +4975,7 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
}
ret = glusterd_gsync_read_frm_status (statefile, buf, sizeof (buf));
- if (ret < 0) {
+ if (ret <= 0) {
gf_msg (this1->name, GF_LOG_ERROR, 0,
GD_MSG_STAT_FILE_READ_FAILED,
"Unable to read the status");
@@ -4986,9 +4986,9 @@ _local_gsyncd_start (dict_t *this, char *key, data_t *value, void *data)
if ((key1 = strchr (slave, '/')))
key1 = key1 + 2;
- /* Looks for the last status, to find if the sessiom was running
- * when the node went down. If the session was not started or
- * not started, do not restart the geo-rep session */
+ /* Looks for the last status, to find if the session was running
+ * when the node went down. If the session was just created or
+ * stopped, do not restart the geo-rep session */
if ((!strcmp (buf, "Created")) ||
(!strcmp (buf, "Stopped"))) {
gf_msg (this1->name, GF_LOG_INFO, 0,