mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
activation: status check switch to warn
When we can't parse status, switch to warning as this is not considered an errornous case. LVS is not supposed to return error status code when device is not what it's been expected to be - but it should be WARNING a user there is something unexpected.
This commit is contained in:
parent
325c2c5687
commit
4a4b22e114
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.169 -
|
Version 2.02.169 -
|
||||||
=====================================
|
=====================================
|
||||||
|
Report log_warn when status cannot be parsed.
|
||||||
Test segment type before accessing segment members when checking status.
|
Test segment type before accessing segment members when checking status.
|
||||||
Implement compatible target function for stripe segment.
|
Implement compatible target function for stripe segment.
|
||||||
Use status info to report merge failed and snapshot invalid lvs fields.
|
Use status info to report merge failed and snapshot invalid lvs fields.
|
||||||
|
@ -126,7 +126,14 @@ static int _get_segment_status_from_target_params(const char *target_name,
|
|||||||
{
|
{
|
||||||
struct segment_type *segtype;
|
struct segment_type *segtype;
|
||||||
|
|
||||||
seg_status->type = SEG_STATUS_UNKNOWN;
|
seg_status->type = SEG_STATUS_UNKNOWN; /* Parsing failed */
|
||||||
|
|
||||||
|
if (!params) {
|
||||||
|
log_warn("WARNING: Cannot find matching %s segment for %s.",
|
||||||
|
seg_status->seg->segtype->name,
|
||||||
|
display_lvname(seg_status->seg->lv));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* TODO: Add support for other segment types too!
|
* TODO: Add support for other segment types too!
|
||||||
@ -141,19 +148,14 @@ static int _get_segment_status_from_target_params(const char *target_name,
|
|||||||
if (!(segtype = get_segtype_from_string(seg_status->seg->lv->vg->cmd, TARGET_NAME_SNAPSHOT)))
|
if (!(segtype = get_segtype_from_string(seg_status->seg->lv->vg->cmd, TARGET_NAME_SNAPSHOT)))
|
||||||
return_0;
|
return_0;
|
||||||
} else {
|
} else {
|
||||||
if (strcmp(target_name, TARGET_NAME_CACHE) &&
|
|
||||||
strcmp(target_name, TARGET_NAME_SNAPSHOT) &&
|
|
||||||
strcmp(target_name, TARGET_NAME_THIN_POOL) &&
|
|
||||||
strcmp(target_name, TARGET_NAME_THIN))
|
|
||||||
return 1; /* TODO: Do not know how to handle yet */
|
|
||||||
|
|
||||||
if (!(segtype = get_segtype_from_string(seg_status->seg->lv->vg->cmd, target_name)))
|
if (!(segtype = get_segtype_from_string(seg_status->seg->lv->vg->cmd, target_name)))
|
||||||
return_0;
|
return_0;
|
||||||
|
|
||||||
|
/* Validate segtype from DM table and lvm2 metadata */
|
||||||
if (segtype != seg_status->seg->segtype) {
|
if (segtype != seg_status->seg->segtype) {
|
||||||
log_error(INTERNAL_ERROR "_get_segment_status_from_target_params: "
|
log_warn("WARNING: segment type %s found does not match "
|
||||||
"segment type %s found does not match expected segment type %s",
|
"expected segment type %s.",
|
||||||
segtype->name, seg_status->seg->segtype->name);
|
segtype->name, seg_status->seg->segtype->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -178,10 +180,9 @@ static int _get_segment_status_from_target_params(const char *target_name,
|
|||||||
if (!dm_get_status_snapshot(seg_status->mem, params, &seg_status->snapshot))
|
if (!dm_get_status_snapshot(seg_status->mem, params, &seg_status->snapshot))
|
||||||
return_0;
|
return_0;
|
||||||
seg_status->type = SEG_STATUS_SNAPSHOT;
|
seg_status->type = SEG_STATUS_SNAPSHOT;
|
||||||
} else {
|
} else
|
||||||
log_error(INTERNAL_ERROR "Unsupported segment type %s.", segtype->name);
|
/* Status not supported */
|
||||||
return 0;
|
seg_status->type = SEG_STATUS_NONE;
|
||||||
}
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user