1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

debug: show proper error message for layer mismatch

Show proper internal error for failing command when there are some
inconsitencies in sizes of LV and its layer instead of rather
meaningless error code 5.

(Could be hit i.e. if user tried to 'resize' cached LV and then
uncache such LV.)
This commit is contained in:
Zdenek Kabelac 2017-01-05 15:49:07 +01:00
parent 3e9c03cbbc
commit d6a74025df

View File

@ -6537,8 +6537,11 @@ int remove_layer_from_lv(struct logical_volume *lv,
parent_seg->area_count != 1 ||
seg_type(parent_seg, 0) != AREA_LV ||
layer_lv != seg_lv(parent_seg, 0) ||
parent_lv->le_count != layer_lv->le_count)
return_0;
parent_lv->le_count != layer_lv->le_count) {
log_error(INTERNAL_ERROR "Inconsistent sizes of layer %s.",
display_lvname(lv));
return 0;
}
if (!lv_empty(parent_lv))
return_0;