From 1f95e55cc633e9b082b4eb37a6a825c0e33ac5c8 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Tue, 3 Jun 2014 11:55:49 +0530 Subject: mgmt/glusterd: return proper value upon quorum failure in snapshot create Change-Id: I5474a7cdf03236121bef383955ab403e945cd7ae BUG: 1101561 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/7961 Reviewed-by: Sachin Pandit Reviewed-by: Krishnan Parthasarathi Tested-by: Gluster Build System Reviewed-by: Kaushal M --- xlators/mgmt/glusterd/src/glusterd-utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'xlators') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index 6f48767b8a3..540e97b8633 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -12607,7 +12607,7 @@ glusterd_snap_quorum_check_for_create (dict_t *dict, gf_boolean_t snap_volume, int64_t volcount = 0; char key[PATH_MAX] = {0, }; int64_t i = 0; - int32_t ret = 0; + int32_t ret = -1; xlator_t *this = NULL; this = THIS; @@ -12630,6 +12630,7 @@ glusterd_snap_quorum_check_for_create (dict_t *dict, gf_boolean_t snap_volume, if (!snap) { gf_log (this->name, GF_LOG_ERROR, "failed to " "get the snapshot %s", snapname); + ret = -1; goto out; } } @@ -12649,6 +12650,7 @@ glusterd_snap_quorum_check_for_create (dict_t *dict, gf_boolean_t snap_volume, gf_log (this->name, GF_LOG_WARNING, "%s", err_str); *op_errstr = gf_strdup (err_str); + ret = -1; goto out; } -- cgit