]> sourceware.org Git - lvm2.git/commitdiff
lvscan: check result of id_write_format
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 19 Aug 2014 12:26:06 +0000 (14:26 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 19 Aug 2014 12:33:06 +0000 (14:33 +0200)
Currently rather impossible to happen - but check
for returned value of id_write_format().

tools/lvscan.c

index 487c4cf1eb11421b46be38bb7205da323021ae72..f05fd50c38be19e458a723bf8842b187981eb966 100644 (file)
@@ -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))
This page took 0.292401 seconds and 5 git commands to generate.