From cdb16a603954a1a3771644a101d0b372f8e0826c Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 19 Aug 2014 14:26:06 +0200 Subject: [PATCH] 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 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/lvscan.c b/tools/lvscan.c index 487c4cf1e..f05fd50c3 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)) -- 2.43.5