mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Fix setting of volume limit count if converting to lvm1 format.
Fixes problem when after downconvert to lvm1 VG is broken: # lvcreate -n lv1 -l 4 vg_test Invalid LV in extent map (PV /dev/sdb1, PE 0, LV 0, LE 0) ...
This commit is contained in:
parent
18c8a64d3c
commit
3a2fb07349
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.40 -
|
Version 2.02.40 -
|
||||||
================================
|
================================
|
||||||
|
Fix setting of volume limit count if converting to lvm1 format.
|
||||||
Fix vgconvert logical volume id metadata validation.
|
Fix vgconvert logical volume id metadata validation.
|
||||||
Fix lvmdump metadata gather option (-m) to work correctly.
|
Fix lvmdump metadata gather option (-m) to work correctly.
|
||||||
Fix allocation bug in text metadata format write error path.
|
Fix allocation bug in text metadata format write error path.
|
||||||
|
@ -1255,6 +1255,13 @@ int vg_validate(struct volume_group *vg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(vg->fid->fmt->features & FMT_UNLIMITED_VOLS) &&
|
||||||
|
(!vg->max_lv || !vg->max_pv)) {
|
||||||
|
log_error("Internal error: Volume group %s has limited PV/LV count"
|
||||||
|
" but limit is not set.", vg->name);
|
||||||
|
r = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,6 +81,15 @@ static int vgconvert_single(struct cmd_context *cmd, const char *vg_name,
|
|||||||
return ECMD_FAILED;
|
return ECMD_FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Set PV/LV limit if converting from unlimited metadata format */
|
||||||
|
if (vg->fid->fmt->features & FMT_UNLIMITED_VOLS &&
|
||||||
|
!(cmd->fmt->features & FMT_UNLIMITED_VOLS)) {
|
||||||
|
if (!vg->max_lv)
|
||||||
|
vg->max_lv = 255;
|
||||||
|
if (!vg->max_pv)
|
||||||
|
vg->max_pv = 255;
|
||||||
|
}
|
||||||
|
|
||||||
/* If converting to restricted lvid, check if lvid is compatible */
|
/* If converting to restricted lvid, check if lvid is compatible */
|
||||||
if (!(vg->fid->fmt->features & FMT_RESTRICTED_LVIDS) &&
|
if (!(vg->fid->fmt->features & FMT_RESTRICTED_LVIDS) &&
|
||||||
cmd->fmt->features & FMT_RESTRICTED_LVIDS)
|
cmd->fmt->features & FMT_RESTRICTED_LVIDS)
|
||||||
|
Loading…
Reference in New Issue
Block a user