1
0
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:
Alasdair Kergon 2003-05-06 12:10:18 +00:00
parent 31abe57cd6
commit 6e03b44cc8
4 changed files with 22 additions and 0 deletions

View File

@ -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,

View File

@ -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\"",

View File

@ -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;

View File

@ -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;