mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
Don't process locked LVs
This commit is contained in:
parent
31abe57cd6
commit
6e03b44cc8
@ -429,6 +429,11 @@ static int _lvcreate(struct cmd_context *cmd, struct lvcreate_params *lp)
|
||||
"yet.");
|
||||
return 0;
|
||||
}
|
||||
if (org->status & LOCKED) {
|
||||
log_error("Snapshots of locked devices are not "
|
||||
"supported yet");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!(lv = lv_create(vg->fid, lp->lv_name, status, alloc,
|
||||
|
@ -39,6 +39,13 @@ static int lvremove_single(struct cmd_context *cmd, struct logical_volume *lv,
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
|
||||
if (lv->status & LOCKED) {
|
||||
log_error("Can't remove locked LV %s", lv->name);
|
||||
return ECMD_FAILED;
|
||||
}
|
||||
|
||||
/* FIXME Ensure not referred to by another existing LVs */
|
||||
|
||||
if (lv_info(lv, &info)) {
|
||||
if (info.open_count) {
|
||||
log_error("Can't remove open logical volume \"%s\"",
|
||||
|
@ -143,6 +143,11 @@ int lvrename(struct cmd_context *cmd, int argc, char **argv)
|
||||
|
||||
lv = lvl->lv;
|
||||
|
||||
if (lv->status & LOCKED) {
|
||||
log_error("Cannot rename locked LV %s", lv->name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (!archive(lv->vg))
|
||||
goto error;
|
||||
|
||||
|
@ -140,6 +140,11 @@ int lvresize(struct cmd_context *cmd, int argc, char **argv)
|
||||
|
||||
lv = lvl->lv;
|
||||
|
||||
if (lv->status & LOCKED) {
|
||||
log_error("Can't resize locked LV %s", lv->name);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (size) {
|
||||
/* No of 512-byte sectors */
|
||||
extents = size * 2;
|
||||
|
Loading…
Reference in New Issue
Block a user