diff --git a/tools/lvcreate.c b/tools/lvcreate.c index e8523b3fe..214ac2fa7 100644 --- a/tools/lvcreate.c +++ b/tools/lvcreate.c @@ -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, diff --git a/tools/lvremove.c b/tools/lvremove.c index 69bb019a9..9d45ad6ab 100644 --- a/tools/lvremove.c +++ b/tools/lvremove.c @@ -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\"", diff --git a/tools/lvrename.c b/tools/lvrename.c index b2671b744..80278670f 100644 --- a/tools/lvrename.c +++ b/tools/lvrename.c @@ -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; diff --git a/tools/lvresize.c b/tools/lvresize.c index 8c26544d9..e22eb3f39 100644 --- a/tools/lvresize.c +++ b/tools/lvresize.c @@ -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;