Skip to contentSkip to conversation

master - metadata: Do not try to check vg_name of a NULL PV.

PATCH Petr Rockai 1 participant 1 message Nov 17, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e1a63905d14cc73352b905c70cb4084b7e521e33
Commit:        e1a63905d14cc73352b905c70cb4084b7e521e33
Parent:        803f8ca7146c548c271c04d432a3c68726a0d37d
Author:        Petr Rockai <[email protected]>
AuthorDate:    Wed Mar 20 14:34:05 2013 +0100
Committer:     Petr Rockai <[email protected]>
CommitterDate: Sun Nov 17 21:41:26 2013 +0100

metadata: Do not try to check vg_name of a NULL PV.

---
 lib/metadata/metadata.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
lib/metadata/metadata.c +1 -1
index 8571e0a..869d368 100644
@@ -1842,7 +1842,7 @@ struct physical_volume *find_pv_by_name(struct cmd_context *cmd,
 		}
 	}
 
-	if (!allow_orphan && is_orphan_vg(pv->vg_name)) {
+	if (pv && !allow_orphan && is_orphan_vg(pv->vg_name)) {
 		log_error("Physical volume %s not in a volume group", pv_name);
 		goto bad;
 	}