mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
cleanup: display_lvname update message
Add more display_lvname usage. Update some error messages. Indent.
This commit is contained in:
parent
7323557379
commit
d437bd86ff
@ -606,12 +606,12 @@ static int _mirrored_lv_in_sync(struct logical_volume *lv)
|
|||||||
NULL)) {
|
NULL)) {
|
||||||
if (lv_is_active_but_not_locally(lv))
|
if (lv_is_active_but_not_locally(lv))
|
||||||
log_error("Unable to determine mirror sync status of"
|
log_error("Unable to determine mirror sync status of"
|
||||||
" remotely active LV, %s/%s",
|
" remotely active LV, %s",
|
||||||
lv->vg->name, lv->name);
|
display_lvname(lv));
|
||||||
else
|
else
|
||||||
log_error("Unable to determine mirror "
|
log_error("Unable to determine mirror "
|
||||||
"sync status of %s/%s.",
|
"sync status of %s.",
|
||||||
lv->vg->name, lv->name);
|
display_lvname(lv));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -700,7 +700,7 @@ static int _split_mirror_images(struct logical_volume *lv,
|
|||||||
|
|
||||||
new_lv->name = dm_pool_strdup(lv->vg->vgmem, split_name);
|
new_lv->name = dm_pool_strdup(lv->vg->vgmem, split_name);
|
||||||
if (!new_lv->name) {
|
if (!new_lv->name) {
|
||||||
log_error("Unable to rename newly split LV");
|
log_error("Unable to rename newly split LV.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1141,14 +1141,14 @@ int collapse_mirrored_lv(struct logical_volume *lv)
|
|||||||
while ((tmp_lv = find_temporary_mirror(lv))) {
|
while ((tmp_lv = find_temporary_mirror(lv))) {
|
||||||
mirror_seg = find_mirror_seg(first_seg(tmp_lv));
|
mirror_seg = find_mirror_seg(first_seg(tmp_lv));
|
||||||
if (!mirror_seg) {
|
if (!mirror_seg) {
|
||||||
log_error("Failed to find mirrored LV for %s",
|
log_error("Failed to find mirrored LV for %s.",
|
||||||
tmp_lv->name);
|
display_lvname(tmp_lv));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_mirrored_lv_in_sync(mirror_seg->lv)) {
|
if (!_mirrored_lv_in_sync(mirror_seg->lv)) {
|
||||||
log_verbose("Not collapsing %s: out-of-sync",
|
log_verbose("Not collapsing %s: out-of-sync.",
|
||||||
mirror_seg->lv->name);
|
display_lvname(mirror_seg->lv));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1339,8 +1339,8 @@ static int _create_mimage_lvs(struct alloc_handle *ah,
|
|||||||
|
|
||||||
for (m = 0; m < num_mirrors; m++) {
|
for (m = 0; m < num_mirrors; m++) {
|
||||||
if (!(img_lvs[m] = lv_create_empty(img_name,
|
if (!(img_lvs[m] = lv_create_empty(img_name,
|
||||||
NULL, LVM_READ | LVM_WRITE,
|
NULL, LVM_READ | LVM_WRITE,
|
||||||
ALLOC_INHERIT, lv->vg))) {
|
ALLOC_INHERIT, lv->vg))) {
|
||||||
log_error("Aborting. Failed to create mirror image LV. "
|
log_error("Aborting. Failed to create mirror image LV. "
|
||||||
"Remove new LV and retry.");
|
"Remove new LV and retry.");
|
||||||
return 0;
|
return 0;
|
||||||
@ -1352,7 +1352,7 @@ static int _create_mimage_lvs(struct alloc_handle *ah,
|
|||||||
if (!lv_add_log_segment(ah, first_area, img_lvs[m], 0)) {
|
if (!lv_add_log_segment(ah, first_area, img_lvs[m], 0)) {
|
||||||
log_error("Failed to add mirror image segment"
|
log_error("Failed to add mirror image segment"
|
||||||
" to %s. Remove new LV and retry.",
|
" to %s. Remove new LV and retry.",
|
||||||
img_lvs[m]->name);
|
display_lvname(img_lvs[m]));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1361,7 +1361,7 @@ static int _create_mimage_lvs(struct alloc_handle *ah,
|
|||||||
stripe_size, 0, 0)) {
|
stripe_size, 0, 0)) {
|
||||||
log_error("Aborting. Failed to add mirror image segment "
|
log_error("Aborting. Failed to add mirror image segment "
|
||||||
"to %s. Remove new LV and retry.",
|
"to %s. Remove new LV and retry.",
|
||||||
img_lvs[m]->name);
|
display_lvname(img_lvs[m]));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1385,13 +1385,14 @@ int remove_mirrors_from_segments(struct logical_volume *lv,
|
|||||||
/* Check the segment params are compatible */
|
/* Check the segment params are compatible */
|
||||||
dm_list_iterate_items(seg, &lv->segments) {
|
dm_list_iterate_items(seg, &lv->segments) {
|
||||||
if (!seg_is_mirrored(seg)) {
|
if (!seg_is_mirrored(seg)) {
|
||||||
log_error("Segment is not mirrored: %s:%" PRIu32,
|
log_error("Segment is not mirrored: %s:" FMTu32,
|
||||||
lv->name, seg->le);
|
display_lvname(lv), seg->le);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ((seg->status & status_mask) != status_mask) {
|
if ((seg->status & status_mask) != status_mask) {
|
||||||
log_error("Segment status does not match: %s:%" PRIu32
|
log_error("Segment status does not match: %s:" FMTu32
|
||||||
" status:0x%" PRIx64 "/0x%" PRIx64, lv->name, seg->le,
|
" status:0x" FMTx64 "/0x" FMTx64,
|
||||||
|
display_lvname(lv), seg->le,
|
||||||
seg->status, status_mask);
|
seg->status, status_mask);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1523,7 +1524,7 @@ struct dm_list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
uint32_t s;
|
uint32_t s;
|
||||||
|
|
||||||
if (!(lvs = dm_pool_alloc(cmd->mem, sizeof(*lvs)))) {
|
if (!(lvs = dm_pool_alloc(cmd->mem, sizeof(*lvs)))) {
|
||||||
log_error("lvs list alloc failed");
|
log_error("lvs list alloc failed.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1542,7 +1543,7 @@ struct dm_list *lvs_using_lv(struct cmd_context *cmd, struct volume_group *vg,
|
|||||||
seg_lv(seg, s) != lv)
|
seg_lv(seg, s) != lv)
|
||||||
continue;
|
continue;
|
||||||
if (!(lvl = dm_pool_alloc(cmd->mem, sizeof(*lvl)))) {
|
if (!(lvl = dm_pool_alloc(cmd->mem, sizeof(*lvl)))) {
|
||||||
log_error("lv_list alloc failed");
|
log_error("lv_list alloc failed.");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
lvl->lv = lv1;
|
lvl->lv = lv1;
|
||||||
|
@ -465,7 +465,7 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
|
|||||||
/* With exclusive pvmove skip LV when:
|
/* With exclusive pvmove skip LV when:
|
||||||
* - is active remotely
|
* - is active remotely
|
||||||
* - is not active locally and cannot be activated exclusively locally
|
* - is not active locally and cannot be activated exclusively locally
|
||||||
*
|
*
|
||||||
* Note: lvm2 can proceed with exclusive pvmove for 'just' locally active LVs
|
* Note: lvm2 can proceed with exclusive pvmove for 'just' locally active LVs
|
||||||
* in the case it's NOT active anywhere else, since LOCKED LVs cannot be
|
* in the case it's NOT active anywhere else, since LOCKED LVs cannot be
|
||||||
* later activated by user.
|
* later activated by user.
|
||||||
|
Loading…
Reference in New Issue
Block a user