summaryrefslogtreecommitdiffstats
path: root/heal
diff options
context:
space:
mode:
authorSheetal Pamecha <spamecha@redhat.com>2019-12-22 22:52:30 +0530
committerAmar Tumballi <amar@kadalu.io>2020-02-03 13:27:37 +0000
commita144cd20745a03f025920ab81265e150e11b3a0a (patch)
treec52ab0153f64d3cdaa041dc66d90a29828e34a1a /heal
parent34347876bb525e1af19bccafbb753a14b358d3aa (diff)
ec: change error message for heal commands for disperse volume
Currently when we issue a heal statistics or similar commands for disperse volume, it fails with message "Volume is not of type replicate." Adding message "this command is supported for volumes of type replicate" to reflect supportability and better understanding of heal functionality for disperse volumes. fixes: bz#1785998 Change-Id: I9688a9fdf427cb6f657cfd5b8db2f76a6c56f6e2 Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
Diffstat (limited to 'heal')
-rw-r--r--heal/src/glfs-heal.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index 20372316edd..7f6de557567 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -1730,14 +1730,19 @@ main(int argc, char **argv)
goto out;
}
+ char *var_str = (heal_op == GF_SHD_OP_INDEX_SUMMARY ||
+ heal_op == GF_SHD_OP_HEAL_SUMMARY)
+ ? "replicate/disperse"
+ : "replicate";
+
ret = glfsh_validate_volume(top_subvol, heal_op);
if (ret < 0) {
ret = -EINVAL;
- gf_asprintf(&op_errstr, "Volume %s is not of type %s", volname,
- (heal_op == GF_SHD_OP_INDEX_SUMMARY ||
- heal_op == GF_SHD_OP_HEAL_SUMMARY)
- ? "replicate/disperse"
- : "replicate");
+ gf_asprintf(&op_errstr,
+ "This command is supported "
+ "for only volumes of %s type. Volume %s "
+ "is not of type %s",
+ var_str, volname, var_str);
goto out;
}
rootloc.inode = inode_ref(top_subvol->itable->root);