pv: mark fake PVs as not used
authorPeter Rajnoha <prajnoha@redhat.com>
Mon, 15 Feb 2016 13:46:31 +0000 (14:46 +0100)
committerPeter Rajnoha <prajnoha@redhat.com>
Mon, 15 Feb 2016 13:46:31 +0000 (14:46 +0100)
Some of the PVs are not even orphan PVs - they're fake PVs - this can
happen if we're listing all devices with "pvs -a". Such PV must not
be marked as used.

lib/metadata/pv.c

index 260eb9bfe2908ccaca43260ee2913c0bea01521a..d5820b5b2fc414d953993edcea19d763596499cd 100644 (file)
@@ -213,6 +213,9 @@ int is_used_pv(const struct physical_volume *pv)
        struct lvmcache_info *info;
        uint32_t ext_flags;
 
+       if (!pv->vg)
+               return 0;
+
        if (!is_orphan(pv))
                return 1;
 
This page took 0.040496 seconds and 5 git commands to generate.