Skip to contentSkip to conversation

master - debug: check for fail in id validation

PATCH Zdenek Kabelac 1 participant 1 message Jun 26, 2017

lore
Share & tools
lore
#0 lore raw
Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c440bb0742fa70ca37ead55b7edd18e2f7a19eda
Commit:        c440bb0742fa70ca37ead55b7edd18e2f7a19eda
Parent:        3e331c8e68d5f80cacc194625ad97ee4c26fc3ee
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Mon Jun 26 23:20:29 2017 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Jun 27 00:27:36 2017 +0200

debug: check for fail in id validation

---
 lib/metadata/metadata.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
lib/metadata/metadata.c +2 -1
index b44f2df..45495dc 100644
@@ -4149,7 +4149,8 @@ static int _check_or_repair_pv_ext(struct cmd_context *cmd,
 		if (!pvl->pv->dev) {
 			/* is_missing_pv doesn't catch NULL dev */
 			memset(&uuid, 0, sizeof(uuid));
-			id_write_format(&pvl->pv->id, uuid, sizeof(uuid));
+			if (!id_write_format(&pvl->pv->id, uuid, sizeof(uuid)))
+				goto_out;
 			log_warn("WARNING: Not repairing PV %s with missing device.", uuid);
 			continue;
 		}