]> sourceware.org Git - lvm2.git/commitdiff
format-text: check for _text_create_text_instance
authorZdenek Kabelac <zkabelac@redhat.com>
Fri, 14 Dec 2012 20:34:28 +0000 (21:34 +0100)
committerZdenek Kabelac <zkabelac@redhat.com>
Sat, 15 Dec 2012 16:23:23 +0000 (17:23 +0100)
Test if 'fid' creation failed and report stack trace,
break the loop and do not pass NULL fid further.

WHATS_NEW
lib/format_text/format-text.c

index 249db0b91ffdfb013fd7cfbcc8d5f975a362eb5f..fcb8897d03267657490ce910c7f7df604a8ca501 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.99 - 
 ===================================
+  Add check for created fid in _scan_file.
   Log output also to syslog when abort_on_internal_error is set.
   Add LV snapshot support to liblvm and python-lvm.
   Avoid a global lock in pvs when lvmetad is in use.
index 476d5d98e5a46af61cc66608915d44d4753d6140..227289fc677c9ffed5ce8ce45bfc80d9fe9e996d 100644 (file)
@@ -1089,7 +1089,10 @@ static int _scan_file(const struct format_type *fmt, const char *vgname)
                                /* FIXME: Check this fid is OK! */
                                fic.type = FMT_INSTANCE_PRIVATE_MDAS;
                                fic.context.private = NULL;
-                               fid = _text_create_text_instance(fmt, &fic);
+                               if (!(fid = _text_create_text_instance(fmt, &fic))) {
+                                       stack;
+                                       break;
+                               }
                                if ((vg = _vg_read_file_name(fid, scanned_vgname,
                                                             path))) {
                                        /* FIXME Store creation host in vg */
This page took 0.048432 seconds and 5 git commands to generate.