]> sourceware.org Git - lvm2.git/commitdiff
When creating new LV, double-check that name is not already in use.
authorAlasdair Kergon <agk@redhat.com>
Thu, 28 May 2009 01:59:37 +0000 (01:59 +0000)
committerAlasdair Kergon <agk@redhat.com>
Thu, 28 May 2009 01:59:37 +0000 (01:59 +0000)
WHATS_NEW
lib/metadata/lv_manip.c

index fe363efcde2fd80489814c00a520c8fa548e4094..c10ddc45f78bbf62e1da4a11a32957ff9d7acf3d 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.48 - 
 ===============================
+  When creating new LV, double-check that name is not already in use.
   Remove /dev/vgname/lvname symlink automatically if LV is no longer visible.
   Rename internal vorigin LV to match visible LV.
   Suppress 'removed' messages displayed when internal LVs are removed.
index 53e92e0f9f686c2c4a531e982645d8fb1588fa60..f5fb7d893c68089198cdeb0ed36b2108be87b0c7 100644 (file)
@@ -1844,6 +1844,10 @@ struct logical_volume *lv_create_empty(const char *name,
                log_error("Failed to generate unique name for the new "
                          "logical volume");
                return NULL;
+       } else if (find_lv_in_vg(vg, name)) {
+               log_error("Unable to create LV %s in Volume Group %s: "
+                         "name already in use.", name, vg->name);
+               return NULL;
        }
 
        log_verbose("Creating logical volume %s", name);
This page took 0.046912 seconds and 5 git commands to generate.