]> sourceware.org Git - lvm2.git/commitdiff
vgname_from_mda now tries to parse for vgname even
authorMilan Broz <mbroz@redhat.com>
Tue, 3 Mar 2009 16:35:32 +0000 (16:35 +0000)
committerMilan Broz <mbroz@redhat.com>
Tue, 3 Mar 2009 16:35:32 +0000 (16:35 +0000)
if rlocn not defined (there is no metadata area).

In most cases it fails in validate_name(),
unfortunately there are situatuions, when
validate_name is ok and later code fails with
checksum error.

Reproducer:

# dd if=/dev/zero of=/dev/loop0

# pvcreate --metadatasize 637k /dev/loop0
  Physical volume "/dev/loop0" successfully created

# pvs /dev/loop0
  /dev/loop0: Checksum error
      PV         VG   Fmt  Attr PSize PFree
        /dev/loop0      lvm2 --   1.00M 1.00M

Signed-off-by: Milan Broz <mbroz@redhat.com>
-

WHATS_NEW
lib/format_text/format-text.c

index 920874d9ea806e134e27a56604daa75c82156746..db7aaaa70bed214865a9877aa9274910a3d07d61 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.45 - 3rd March 2009
 ================================
+  Avoid scanning empty metadata areas for VG names.
   Attempt proper clean up in child before executing new binary in exec_cmd().
   Do not scan devices if reporting only attributes from PV label.
   Use pkgconfig to obtain corosync library details during configuration.
index 768446fb6c5d7517f79abbc80296566b36a32149..b70a97f6153bc0d4f8dd2e13374ce52977ae48a0 100644 (file)
@@ -1061,6 +1061,12 @@ const char *vgname_from_mda(const struct format_type *fmt,
        /* FIXME Cope with returning a list */
        rlocn = mdah->raw_locns;
 
+       /*
+        * If no valid offset, do not try to search for vgname
+        */
+       if (!rlocn->offset)
+               goto out;
+
        /* Do quick check for a vgname */
        if (!dev_read(dev_area->dev, dev_area->start + rlocn->offset,
                      NAME_LEN, buf))
This page took 0.041033 seconds and 5 git commands to generate.