]> sourceware.org Git - lvm2.git/commitdiff
o spot empty list in build_vg
authorJoe Thornber <thornber@redhat.com>
Tue, 9 Oct 2001 17:09:46 +0000 (17:09 +0000)
committerJoe Thornber <thornber@redhat.com>
Tue, 9 Oct 2001 17:09:46 +0000 (17:09 +0000)
lib/activate/activate.c
lib/activate/activate.h
lib/format1/format1.c
old-tests/format1/read_vg_t.c

index 602cbee2d74faa3023e90f557939aa3cb1867678..8f77851c20fb4b573a334b206b80c335d3f8721d 100644 (file)
@@ -7,12 +7,14 @@
 #include "activate.h"
 
 int lv_activate(struct dmfs *dm,
-               struct volume_group *vg, struct logical_volume *lv)
+               struct volume_group *vg,
+               struct logical_volume *lv)
 {
-       
+
 }
 
-int lv_deactivate(struct dmfs *dm, struct volume_group *vg,
+int lv_deactivate(struct dmfs *dm,
+                 struct volume_group *vg,
                  struct logical_volume *lv)
 {
 
index 921fa5f68e7f20a2ca5c4a0ad5c3e262ffe09e06..90d045fb6ee4e19d95aba68496f796873ae97182 100644 (file)
 #include "dmfs-driver.h"
 
 int lv_activate(struct dmfs *dm,
-               struct volume_group *vg, struct logical_volume *lv);
+               struct volume_group *vg,
+               struct logical_volume *lv);
 
-int lv_deactivate(struct dmfs *dm, struct volume_group *vg,
+int lv_deactivate(struct dmfs *dm,
+                 struct volume_group *vg,
                  struct logical_volume *lv);
 
 #endif
index b8377bd31433573d7fbf2e6491076b2934e0d813..729f9b8fd6a76cf9421a4f0ba039486286419e56 100644 (file)
@@ -35,13 +35,16 @@ static int _check_vgs(struct list_head *pvs)
 static struct volume_group *_build_vg(struct pool *mem, struct list_head *pvs)
 {
        struct volume_group *vg = pool_alloc(mem, sizeof(*vg));
-       struct disk_list *dl = list_entry(pvs->next, struct disk_list, list);
+       struct disk_list *dl;
 
-       if (!dl) {
+
+       if (list_empty(pvs)) {
                log_err("no pv's in volume group");
                return NULL;
        }
 
+       dl = list_entry(pvs->next, struct disk_list, list);
+
        if (!vg) {
                stack;
                return NULL;
index ca700b9ac4f2869c1e9d475bb05a929b7915c000..a5c93a2a6afcd3f589e210d9d0ee637b89e00329 100644 (file)
@@ -31,7 +31,7 @@ int main(int argc, char **argv)
                exit(1);
        }
 
-       if (!dev_cache_add_dir("/dev/")) {
+       if (!dev_cache_add_dir("/dev/loop")) {
                fprintf(stderr, "couldn't add /dev to dir-cache\n");
                exit(1);
        }
This page took 0.055978 seconds and 5 git commands to generate.