17b94a
From 3d50207b346cb5d95af94aa010ebd1ec3e795554 Mon Sep 17 00:00:00 2001
17b94a
From: srijan-sivakumar <ssivakum@redhat.com>
17b94a
Date: Wed, 4 Nov 2020 11:44:51 +0530
17b94a
Subject: [PATCH 477/478] glusterd/snapshot: Snapshot prevalidation failure not
17b94a
 failing.
17b94a
17b94a
The value of `ret` is to be set to `-1` to indicate failure
17b94a
or else the prevalidation which is supposed to be a failure
17b94a
as the snapshot isn't even activated for cloning will move
17b94a
to next stage.
17b94a
17b94a
Label: DOWNSTREAM ONLY
17b94a
BUG: 1837926
17b94a
17b94a
Change-Id: I95122c3a261332630efa00033a1892a8f95fc00b
17b94a
Signed-off-by: srijan-sivakumar <ssivakum@redhat.com>
17b94a
Reviewed-on: https://code.engineering.redhat.com/gerrit/216920
17b94a
Tested-by: RHGS Build Bot <nigelb@redhat.com>
17b94a
Reviewed-by: Shwetha Acharya <sacharya@redhat.com>
17b94a
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
17b94a
---
17b94a
 xlators/mgmt/glusterd/src/glusterd-snapshot.c | 5 +++--
17b94a
 1 file changed, 3 insertions(+), 2 deletions(-)
17b94a
17b94a
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
17b94a
index 5b8ae97..ee3cea0 100644
17b94a
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
17b94a
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
17b94a
@@ -2298,8 +2298,8 @@ glusterd_snapshot_clone_prevalidate(dict_t *dict, char **op_errstr,
17b94a
         goto out;
17b94a
     }
17b94a
 
17b94a
-
17b94a
     if (!glusterd_is_volume_started(snap_vol)) {
17b94a
+        ret = -1;
17b94a
         snprintf(err_str, sizeof(err_str),
17b94a
                  "Snapshot %s is "
17b94a
                  "not activated",
17b94a
@@ -9361,7 +9361,8 @@ glusterd_handle_snapshot_fn(rpcsvc_request_t *req)
17b94a
                  "for a snapshot");
17b94a
         op_errno = EG_OPNOTSUP;
17b94a
         gf_msg(this->name, GF_LOG_ERROR, 0, GD_MSG_UNSUPPORTED_VERSION,
17b94a
-               "%s (%d < %d)", err_str, conf->op_version, GD_OP_VERSION_RHS_3_0);
17b94a
+               "%s (%d < %d)", err_str, conf->op_version,
17b94a
+               GD_OP_VERSION_RHS_3_0);
17b94a
         ret = -1;
17b94a
         goto out;
17b94a
     }
17b94a
-- 
17b94a
1.8.3.1
17b94a