]> sourceware.org Git - lvm2.git/commitdiff
cov: check fid instance is created
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 20 Sep 2021 00:09:16 +0000 (02:09 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 20 Sep 2021 12:26:09 +0000 (14:26 +0200)
tools/pvscan.c

index d24ee5724a6e8242154585aded6e7c239166f211..ec33c9a9a01f615b589ad211e34b18fbad480283 100644 (file)
@@ -1234,7 +1234,12 @@ static int _online_devs(struct cmd_context *cmd, int do_all, struct dm_list *pvs
                }
 
                fmt = lvmcache_fmt(info);
-               fid = fmt->ops->create_instance(fmt, &fic);
+               if (!(fid = fmt->ops->create_instance(fmt, &fic))) {
+                       log_error("pvscan[%d] failed to create format instance.", getpid());
+                       ret = 0;
+                       continue;
+               }
+
                vg = NULL;
 
                mda1 = lvmcache_get_dev_mda(dev, 1);
This page took 0.039132 seconds and 5 git commands to generate.