summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2020-05-21 16:04:33 +0530
committerSunny Kumar <sunkumar@redhat.com>2020-05-22 15:50:25 +0000
commit2ae5f8eaaf1034ae2bccd90521427d4f171ee3a3 (patch)
tree81e5c400b4acf5125916a4a3cc96b205b1997589
parent29ec66c6ab77e2d6893c6e213a3d1fb148702c99 (diff)
glusterd/snapshot: Improve log message during snapshot clone
While taking a snapshot clone, if the snapshot is not activated, th cli was returning that the bricks are down. This patch clearly print tha the error is due to the snapshot state. Change-Id: Ia840e6e071342e061ad38bf15e2e2ff2b0dacdfa Fixes: #1255 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index 4703a07..6294951 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -2188,6 +2188,16 @@ glusterd_snapshot_clone_prevalidate(dict_t *dict, char **op_errstr,
goto out;
}
+ if (!glusterd_is_volume_started(snap_vol)) {
+ snprintf(err_str, sizeof(err_str),
+ "Snapshot %s is "
+ "not activated",
+ snap->snapname);
+ loglevel = GF_LOG_WARNING;
+ *op_errno = EG_VOLSTP;
+ goto out;
+ }
+
ret = dict_get_bin(dict, "vol1_volid", (void **)&snap_volid);
if (ret) {
gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_DICT_GET_FAILED,