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