Gitweb:
http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=cdb16a603954a1...
Commit: cdb16a603954a1a3771644a101d0b372f8e0826c
Parent: ad9aee9af46690032a0480ebd1023f400ea15841
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 19 14:26:06 2014 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 19 14:33:06 2014 +0200
lvscan: check result of id_write_format
Currently rather impossible to happen - but check
for returned value of id_write_format().
---
tools/lvscan.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tools/lvscan.c b/tools/lvscan.c
index 487c4cf..f05fd50 100644
--- a/tools/lvscan.c
+++ b/tools/lvscan.c
@@ -33,9 +33,11 @@ static int _lvscan_single_lvmetad(struct cmd_context *cmd, struct
logical_volume
dm_list_iterate_items(pvl, &all_pvs) {
if (!pvl->pv->dev) {
- id_write_format(&pvl->pv->id, pvid_s, sizeof(pvid_s));
- log_warn("WARNING: Device for PV %s already missing, skipping.",
- pvid_s);
+ if (!id_write_format(&pvl->pv->id, pvid_s, sizeof(pvid_s)))
+ stack;
+ else
+ log_warn("WARNING: Device for PV %s already missing, skipping.",
+ pvid_s);
continue;
}
if (!lvmetad_pvscan_single(cmd, pvl->pv->dev, NULL))