summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-11-25 13:46:06 +0100
committerZdenek Kabelac <zkabelac@redhat.com>2016-11-25 14:58:28 +0100
commit1d58074d9fc4a01c5ca99af0ba26a5521a541092 (patch)
tree35b0966442c289223aac7212fca5371bcc44b3d8 /tools
parent2ad66b4e7bf1c88bd57b6d97f9feb07b99ae3e19 (diff)
downloadlvm2-1d58074d9fc4a01c5ca99af0ba26a5521a541092.tar.gz
debug: more stacktrace corrections
Continue previous patch dropping some unneeded stack traces after printed log_error/warn messages.
Diffstat (limited to 'tools')
-rw-r--r--tools/dmsetup.c6
-rw-r--r--tools/lvcreate.c2
-rw-r--r--tools/pvmove.c4
-rw-r--r--tools/toollib.c8
-rw-r--r--tools/vgimportclone.c17
5 files changed, 19 insertions, 18 deletions
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index e48f0a611..f0682931f 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -691,9 +691,11 @@ static int _do_usleep_wait(void)
if (usleep(this_interval / NSEC_PER_USEC)) {
if (errno == EINTR)
log_error("Report interval interrupted by signal.");
- if (errno == EINVAL)
+ else if (errno == EINVAL)
log_error("Report interval too short.");
- return_0;
+ else
+ stack; /* other reason */
+ return 0;
}
if (_count == 2) {
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index dbc070812..f70984a51 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1591,7 +1591,7 @@ static int _lvcreate_single(struct cmd_context *cmd, const char *vg_name,
if (vg->lock_type && !strcmp(vg->lock_type, "sanlock")) {
if (!handle_sanlock_lv(cmd, vg)) {
log_error("No space for sanlock lock, extend the internal lvmlock LV.");
- goto_out;
+ goto out;
}
}
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 3877562bb..eef5cc1b0 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -187,12 +187,12 @@ static int _remove_sibling_pvs_from_trim_list(struct logical_volume *lv,
if (!(sublv = find_lv(lv->vg, sublv_name))) {
log_error("Can't find sub LV %s?", sublv_name);
- return_0;
+ return 0;
}
if (!get_pv_list_for_lv(lv->vg->cmd->mem, sublv, &untrim_list)) {
log_error("Can't find PVs for sub LV %s?", sublv_name);
- return_0;
+ return 0;
}
dm_list_iterate(pvh1, &untrim_list) {
diff --git a/tools/toollib.c b/tools/toollib.c
index 9763362d0..356293710 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2474,7 +2474,7 @@ int process_each_lv_in_vg(struct cmd_context *cmd, struct volume_group *vg,
if (!(final_lvl = dm_pool_zalloc(cmd->mem, sizeof(struct lv_list)))) {
log_error("Failed to allocate final LV list item.");
ret_max = ECMD_FAILED;
- goto_out;
+ goto out;
}
final_lvl->lv = lvl->lv;
dm_list_add(&final_lvs, &final_lvl->list);
@@ -4710,7 +4710,7 @@ int pvcreate_each_device(struct cmd_context *cmd,
if (!lock_vol(cmd, VG_ORPHANS, LCK_VG_WRITE, NULL)) {
log_error("Can't get lock for orphan PVs.");
- goto_out;
+ goto out;
}
/*
@@ -4742,7 +4742,7 @@ int pvcreate_each_device(struct cmd_context *cmd,
if (dm_list_empty(&pp->arg_process)) {
log_debug("No devices to process.");
- goto_bad;
+ goto bad;
}
do_command:
@@ -4789,7 +4789,7 @@ do_command:
if (!(orphan_vg = vg_read_internal(cmd, pp->orphan_vg_name, NULL, 0, &consistent))) {
log_error("Cannot read orphans VG %s.", pp->orphan_vg_name);
- goto_bad;
+ goto bad;
}
dm_list_iterate_items_safe(pd, pd2, &pp->arg_create) {
diff --git a/tools/vgimportclone.c b/tools/vgimportclone.c
index 09b3a7c3f..b23b14e87 100644
--- a/tools/vgimportclone.c
+++ b/tools/vgimportclone.c
@@ -75,12 +75,12 @@ static int _vgimportclone_vg_single(struct cmd_context *cmd, const char *vg_name
if (vg_is_exported(vg) && !vp->import_vg) {
log_error("VG %s is exported, use the --import option.", vg->name);
- goto_bad;
+ goto bad;
}
if (vg_status(vg) & PARTIAL_VG) {
log_error("VG %s is partial, it must be complete.", vg->name);
- goto_bad;
+ goto bad;
}
/*
@@ -121,7 +121,7 @@ static int _vgimportclone_vg_single(struct cmd_context *cmd, const char *vg_name
log_error("PV with UUID %s is part of VG %s, but is not included in the devices to import.",
uuid, vg->name);
log_error("All PVs in the VG must be imported together.");
- goto_bad;
+ goto bad;
}
}
@@ -130,7 +130,7 @@ static int _vgimportclone_vg_single(struct cmd_context *cmd, const char *vg_name
/* device arg is not in the VG. */
log_error("Device %s was not found in VG %s.", dev_name(vd->dev), vg->name);
log_error("The devices to import must match the devices in the VG.");
- goto_bad;
+ goto bad;
}
}
@@ -245,7 +245,7 @@ int vgimportclone(struct cmd_context *cmd, int argc, char **argv)
if (vp.found_args != argc) {
log_error("Failed to find all devices.");
- goto_out;
+ goto out;
}
/*
@@ -256,12 +256,12 @@ int vgimportclone(struct cmd_context *cmd, int argc, char **argv)
dm_list_iterate_items(vd, &vp.arg_import) {
if (!(info = lvmcache_info_from_pvid(vd->dev->pvid, NULL, 0))) {
log_error("Failed to find PVID for device %s in lvmcache.", dev_name(vd->dev));
- goto_out;
+ goto out;
}
if (!(vgname = lvmcache_vgname_from_info(info))) {
log_error("Failed to find VG name for device %s in lvmcache.", dev_name(vd->dev));
- goto_out;
+ goto out;
}
if (!vp.old_vgname) {
@@ -270,7 +270,7 @@ int vgimportclone(struct cmd_context *cmd, int argc, char **argv)
} else {
if (strcmp(vp.old_vgname, vgname)) {
log_error("Devices must be from the same VG.");
- goto_out;
+ goto out;
}
}
}
@@ -360,4 +360,3 @@ out:
return ret;
}
-