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:
parent
87331dc419
commit
386f3d5a5e
@ -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\" "
|
||||
|
@ -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) ||
|
||||
|
@ -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" :
|
||||
|
Loading…
x
Reference in New Issue
Block a user