1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-23 13:57:47 +03:00

thin: validation catch multiseg thin pool/volumes

Multisegment thin pools and volumes are not supported.
Catch such error code path early.
This commit is contained in:
Zdenek Kabelac 2013-09-06 14:07:39 +02:00
parent 655296609e
commit 0670bfeb59
2 changed files with 21 additions and 10 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.101 -
===================================
Check for exactly one lv segment in validation of thin pools and volumes.
Fix dmeventd unmonitoring of thin pools.
Fix lvresize for stacked thin pool volumes (i.e. mirrors).
Write Completed debug message before reinstating log defaults after command.

View File

@ -76,18 +76,28 @@ int check_lv_segments(struct logical_volume *lv, int complete_vg)
/* Check LV flags match first segment type */
if (complete_vg) {
if (lv_is_thin_volume(lv) &&
(!(seg2 = first_seg(lv)) || !seg_is_thin_volume(seg2))) {
log_error("LV %s is thin volume without first thin volume segment",
lv->name);
inc_error_count;
if (lv_is_thin_volume(lv)) {
if (dm_list_size(&lv->segments) != 1) {
log_error("LV %s is thin volume without exactly one segment.",
lv->name);
inc_error_count;
} else if (!seg_is_thin_volume(first_seg(lv))) {
log_error("LV %s is thin volume without first thin volume segment.",
lv->name);
inc_error_count;
}
}
if (lv_is_thin_pool(lv) &&
(!(seg2 = first_seg(lv)) || !seg_is_thin_pool(seg2))) {
log_error("LV %s is thin pool without first thin pool segment",
lv->name);
inc_error_count;
if (lv_is_thin_pool(lv)) {
if (dm_list_size(&lv->segments) != 1) {
log_error("LV %s is thin pool volume without exactly one segment.",
lv->name);
inc_error_count;
} else if (!seg_is_thin_pool(first_seg(lv))) {
log_error("LV %s is thin pool without first thin pool segment.",
lv->name);
inc_error_count;
}
}
if (lv_is_thin_pool_data(lv) &&