1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

thin: external origin cannot be changed

Do not allow conversion of external origin into writeable LV,
and prohibit changing the external origin size.

If the snapshot origin is also external origin, merge is prohibited.
This commit is contained in:
Zdenek Kabelac 2013-02-05 14:03:43 +01:00
parent 87331dc419
commit 386f3d5a5e
3 changed files with 21 additions and 0 deletions

View File

@ -36,6 +36,12 @@ static int lvchange_permission(struct cmd_context *cmd,
return 0;
}
if (lv_is_external_origin(lv)) {
log_error("Cannot change permissions of external origin "
"\"%s\".", lv->name);
return 0;
}
if ((lv->status & MIRRORED) && (vg_is_clustered(lv->vg)) &&
lv_info(cmd, lv, 0, &info, 0, 0) && info.exists) {
log_error("Cannot change permissions of mirror \"%s\" "

View File

@ -2109,6 +2109,12 @@ static int _lvconvert_single(struct cmd_context *cmd, struct logical_volume *lv,
lv->name);
return ECMD_FAILED;
}
if (lv_is_external_origin(origin_from_cow(lv))) {
log_error("Cannot merge snapshot \"%s\" into "
"the read-only external origin \"%s\".",
lv->name, origin_from_cow(lv)->name);
return ECMD_FAILED;
}
if (lv_info(lv->vg->cmd, lv, 0, &info, 1, 0)
&& info.exists && info.live_table &&
(!lv_snapshot_percent(lv, &snap_percent) ||

View File

@ -390,6 +390,15 @@ static int _lvresize(struct cmd_context *cmd, struct volume_group *vg,
return ECMD_FAILED;
}
if (lv_is_external_origin(lvl->lv)) {
/*
* Since external-origin can be activated read-only,
* there is no way to use extended areas.
*/
log_error("Cannot resize external origin \"%s\".", lvl->lv->name);
return EINVALID_CMD_LINE;
}
if (lvl->lv->status & (RAID_IMAGE | RAID_META)) {
log_error("Cannot resize a RAID %s directly",
(lvl->lv->status & RAID_IMAGE) ? "image" :