]> sourceware.org Git - lvm2.git/commitdiff
Don't process locked LVs
authorAlasdair Kergon <agk@redhat.com>
Tue, 6 May 2003 12:10:18 +0000 (12:10 +0000)
committerAlasdair Kergon <agk@redhat.com>
Tue, 6 May 2003 12:10:18 +0000 (12:10 +0000)
tools/lvcreate.c
tools/lvremove.c
tools/lvrename.c
tools/lvresize.c

index e8523b3fe19bb4d15ba201989ea2baa89fdcac32..214ac2fa776215713616fa919fd46233623b5a3e 100644 (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,
index 69bb019a94e5a0d0e15abf596fbe6667989c68fc..9d45ad6ab8b7371176015ace7a22c7dae9cbd996 100644 (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\"",
index b2671b74404e1d0a70c4a13822fd4ad40b578b91..80278670f4c0ce453885e1095a4ce0bb7c9f0729 100644 (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;
 
index 8c26544d94d0813ac2f89c8a6efa633435a18a54..e22eb3f394dca01fe9970488cae70097de86adc3 100644 (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;
This page took 0.037479 seconds and 5 git commands to generate.