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