diff options
-rw-r--r-- | tools/lvcreate.c | 5 | ||||
-rw-r--r-- | tools/lvremove.c | 7 | ||||
-rw-r--r-- | tools/lvrename.c | 5 | ||||
-rw-r--r-- | tools/lvresize.c | 5 |
4 files changed, 22 insertions, 0 deletions
diff --git a/tools/lvcreate.c b/tools/lvcreate.c index e8523b3f..214ac2fa 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 69bb019a..9d45ad6a 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 b2671b74..80278670 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 8c26544d..e22eb3f3 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; |