diff options
Diffstat (limited to 'heal/src/glfs-heal.c')
| -rw-r--r-- | heal/src/glfs-heal.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c index 0ce9defc83a..bf4b47f8760 100644 --- a/heal/src/glfs-heal.c +++ b/heal/src/glfs-heal.c @@ -12,15 +12,13 @@ #include <stdlib.h> #include <errno.h> #include "glfs.h" -#include "glfs-handles.h" #include "glfs-internal.h" #include "protocol-common.h" -#include "syscall.h" -#include "syncop.h" -#include "syncop-utils.h" +#include <glusterfs/syscall.h> +#include <glusterfs/syncop.h> +#include <glusterfs/syncop-utils.h> #include <string.h> -#include <time.h> -#include "glusterfs.h" +#include <glusterfs/glusterfs.h> #include <libgen.h> #if (HAVE_LIB_XML) @@ -1057,6 +1055,10 @@ glfsh_set_heal_options(glfs_t *fs, gf_xl_afr_op_t heal_op) if (ret) goto out; + ret = glfs_set_xlator_option(fs, "*-replicate-*", "halo-enabled", "off"); + if (ret) + goto out; + if ((heal_op != GF_SHD_OP_SBRAIN_HEAL_FROM_BIGGER_FILE) && (heal_op != GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK) && (heal_op != GF_SHD_OP_SBRAIN_HEAL_FROM_LATEST_MTIME)) @@ -1146,7 +1148,8 @@ glfsh_gather_heal_info(glfs_t *fs, xlator_t *top_subvol, loc_t *rootloc, while (xl->next) xl = xl->next; while (xl) { - if (strcmp(xl->type, "protocol/client") == 0) { + if (strcmp(xl->type, "protocol/client") == 0 && + !strstr(xl->name, "-ta-")) { heal_xl = _get_ancestor(xl, heal_op); if (heal_xl) { old_THIS = THIS; @@ -1688,6 +1691,12 @@ main(int argc, char **argv) goto out; } + ret = glfs_setfspid(fs, GF_CLIENT_PID_GLFS_HEAL); + if (ret) { + printf("Setting client pid failed, %s\n", strerror(errno)); + goto out; + } + ret = glfs_init(fs); if (ret < 0) { ret = -errno; @@ -1720,14 +1729,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); |
