diff options
author | Peter Rajnoha <prajnoha@redhat.com> | 2016-02-15 14:46:31 +0100 |
---|---|---|
committer | Peter Rajnoha <prajnoha@redhat.com> | 2016-02-15 14:46:31 +0100 |
commit | 0000db7f98a07aa31c5b1cf13938b612e7f2821b (patch) | |
tree | 4f54131aac9902db08a670e5560d16c7fdd84511 | |
parent | abbaeef096251c4191e6da2518e646dd78b82da8 (diff) | |
download | lvm2-0000db7f98a07aa31c5b1cf13938b612e7f2821b.tar.gz |
pv: mark fake PVs as not used
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.
-rw-r--r-- | lib/metadata/pv.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/metadata/pv.c b/lib/metadata/pv.c index 260eb9bfe..d5820b5b2 100644 --- a/lib/metadata/pv.c +++ b/lib/metadata/pv.c @@ -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; |